Quote:
|
Originally Posted by byte2002
I, from a visual basic module, call to the procedure in the following way:
Declare Sub Proc2 Lib "p32.dll" (ByRef mat_a As Double, ByVal p As Integer, ByVal nmax As Integer, ByRef vector_d As Double, ByRef vector_e As Double)
and I pass the values this way:
Call Proc2(mat_a(1, 1), p, nmax, vector_d(1), vector_e(1))
|
Look at the
external directive. Open up the VCL source-code (say
Windows.pas) and look at how the declarations to Windows-API routines are declared.
Also take note of
stdcall. There are several "calling conventions," which determine exactly
how parameters are passed to-and-from the called routine.
Finally, in the declaration of a routine, the Visual Basic
byRef is accomplished by using the keywords
var or
const in the procedure-declaration. The opposite,
byVal, is the default in Delphi.
I politely point out that this particular subject is
very well-covered in the Delphi documentation. There's much more to say about the subject, and these docs are pretty complete.