
 This project builds a VB compatible DLL using
 BCX and LCC-Win32.  TEST.EXE was created using
 VB5 and therefore requires that VB runtime to
 be installed on your system.  TEST.EXE also
 needs MULT.DLL in order to function correctly.

 BCX v1.85 introduces keywords: BYREF, DECLARE and STDCALL

 BYREF is used to specify when a variable, whether
 scaler or array, is to be passed BY REFERENCE to
 a SUB or FUNCTION.  BYREF allows your SUBS and FUNCTIONS
 to modify the contents of their arguments.

 STDCALL is used to create VB compatible DLL files.
 It's usage is:  $DLL STDCALL


 Note that there is a bug in VB ( big surprise! ) that
 makes it necessary to DECLARE arrays without
 specifying the parenthesis () in the VB declaration.


 Note also how we code up the VB DECLARE Alias.  The
 decorated DLL exported name in this case is "_Mult@16".

 The BCX name was Mult.  So to figure out the decorated
 name all you have to do is add an underscore to the
 left of the BCX name, add an "@" character at the right
 of the BCX name, and add a number that is ...

 FOUR (4) TIMES THE NUMBER OF ARGUMENTS.

 Therefore, "Mult"  becomes "_Mult16" in this case, because
 there are 4 arguments being passed.  Simple!

  -----------------------------
  Here is the VB Declaration:
  -----------------------------
  Private Declare Sub Mult Lib "mult.dll" Alias "_Mult@16" _
  (a As Single, b As Single, C As Single, ByVal n As Long)

  -----------------------------------------------
  And here is the VB code that calls our new DLL!
  -----------------------------------------------

  Private Sub Command1_Click()

  Dim a(10) As Single, b(10) As Single, C(10) As Single, n As Integer

  For n = 1 To 10
    a(n) = n * 1.1
    b(n) = n * 2.2
  Next n

  Call Mult(a(0), b(0), C(0), 10)

  Form1.Cls

  For n = 1 To 10
    Form1.Print "   C("; Format$(n); ")= "; Format$(C(n))
  Next

  End Sub
