Board index » delphi » Delphi Dll in Excel

Delphi Dll in Excel

Bin,
   Looks my my thread concerning Excel and Delphi dll has dropped off.
You said a VBA long mapped to a Delphi integer.  I tried this and still
got garbage.  In fact, every datatype is seen on the Delphi side as
garbage.  To refresh:  I have a function exported in a DLL:
      function foo(SomeDataType : DelphiType)....
I call it from Excell VBA.  I set the breakpoint on the Delphi side
and the Delphi watch sees the parameter as something totally different
that what VBA sent it.  No matter what the datatype, the Delphi app
never sees the data as passed.  It does not appear to be a mapping
problem.
 

Re:Delphi Dll in Excel


Heres my previous post:

Integer in Delphi maps to Long in VB. Also VB uses ByRef (var param type in
Delphi) by default; use ByVal for by-value params. So an exported function
in Delphi that looks like this:

function foo (fooparam : integer) : integer; stdcall;

should be imported into VB as

declare function foo Lib "x" (ByVal fooparam As long) As long

have fun
--
Binh Ly
Brickhouse Data Systems, Inc.
http://www.brickhouse.com

Quote
BSkogen wrote in message <35F97F56.1...@EFaxInc.Com>...
>Bin,
>   Looks my my thread concerning Excel and Delphi dll has dropped off.
>You said a VBA long mapped to a Delphi integer.  I tried this and still
>got garbage.  In fact, every datatype is seen on the Delphi side as
>garbage.  To refresh:  I have a function exported in a DLL:
>      function foo(SomeDataType : DelphiType)....
>I call it from Excell VBA.  I set the breakpoint on the Delphi side
>and the Delphi watch sees the parameter as something totally different
>that what VBA sent it.  No matter what the datatype, the Delphi app
>never sees the data as passed.  It does not appear to be a mapping
>problem.

Other Threads