Stefan-

Realistically I won't get back to this before Monday. I've tried
various combinations of __stdcall, __declspec(dllexport), and
__pascal, but haven't found a combination that lets me create a DLL
that's compatible with Delphi yet. The __declspec(dllexport) is
necessary in order for the functions to be exported from the DLL.

__declspec(dllexport)         only
Addr:004012D0 Ord:   3 (0003h) Name: TBP_GETNAME!$$$!QPCI

__stdcall _declspec(dllexport)
Addr:004012D0 Ord:   3 (0003h) Name: TBP_GetName((short,char*,int))

__declspec(pascalimplementation, dllexport)
Addr:00401330 Ord:   3 (0003h) Name: TBP_GetName(char*,int)

__pascal __declspec(dllexport)
Addr:004012D0 Ord:   3 (0003h) Name: TBP_GetName((short,char*,int))

I think it has to do with BC++ still trying to do name-mangling of a
sort. I changed the project calling convention option from the default
of "C" to "Pascal" and that got things closer. The underscores and
C++ name-mangling are the compiler defaults unless you change them
explicitly. Borland's help file says that the Pascal calling
convention makes the exported function names uppercase, but I haven't
found this to be true.

I would think, this being a Borland compiler, that there would be an
easily-configurable setting for Delphi compatibility, but if it's
there it's doing a good job of hiding from me. I suppose the easy
route would be to switch compilers, but I'm obstinate enough at the
moment to keep after this.

Saturday, January 18, 2003, 6:03:26 PM, you wrote:

ST> Did you work out what was wrong with the call convention? I think you
ST> just should add "stdcall" in TBP_XXX function declaration (if I
ST> remember it right, BC++ does not require underscores, but I can be
ST> wrong). Also, somebody knows whether "WINAPI" may replace "stdcall" ?


-Mark Wieder

 Using The Bat! v1.61 on Windows 2000 5.0 Build 2195 Service Pack 2
-- 


________________________________________________
Current version is 1.62 | "Using TBDEV" information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to