Hi everyone. I'm trying to use some of my Delphi functions in Excel VBA, among which, many have "String" parameters. I'm compiling my functions into a Delphi DLL and to avoid using "BORLNDMM.DLL", I'm defining the string types as PChar in Delphi. Now I can't seem to find a way to call any of my functions (passing strings to them) from within VBA without getting the "Bad DLL Calling Convention" error message from Excel. An example of my code is:
-------------
In Delphi:
exports Test;![]()
Please Login or Register to view this content.
-------------
In VBA:
-------------![]()
Please Login or Register to view this content.
I have tried PChar and PWideChar in Delphi, Variant and String and also ByVal and ByRef in VBA but so far, I've been out of luck. Any ideas?
Bookmarks