Thread View: comp.lang.pascal.delphi.misc
1 messages
1 total messages
Started by VC-Interfacer
Sat, 18 Mar 2000 00:00
Calling DLL's made by VC++ from Delphi 5.0 ?
Author: VC-Interfacer
Date: Sat, 18 Mar 2000 00:00
Date: Sat, 18 Mar 2000 00:00
44 lines
2615 bytes
2615 bytes
Calling DLL's made by VC++ from Delphi 5.0 ? The easiest situation, of course, is, if the programmer of the VC++ DLL has put every exported function declaration inside a extern "C" -block and used the stdcall -directive, in which case there should be no problem. However, if the programmer of the DLL made by VC++ hasn't done anything special, but left everything as it is by default, with the assumption, that the calling program would also be made by VC++, then there will very likely be on or more of the following problems: 1. Calling convention: - What is the default calling convention of VC++, and does Delphi support it ? If not, what are the technical details of that calling convention, to make it possible to write some assembler code to resolve the problem ? 2. C++ Name mangling and Case sensitivity: Internal C and C++ names, unlike Delphi's, are case sensitive. What about exported function names? With Delphi 1.0, I would use TDUMP -m CPPDLL.DLL to find out the exported function names. Is this still so with Delphi 5.0 ? 3. If some VC++ functions allocate memory on behalf of the calling program, how is it with malloc and free ? Does VC++'s free( ) need any other parameters than the pointer to free ? (to tell the size of the block to free, like Delphi's FreeMem) Are they just wrappers around windows32's GlobalAlloc and GlobalFree, or do they use a similar, but not compatible, sub-allocator as Delphi does (unless you set the limit for "small" allocation block size so that every allocation gets it's own block directly from GlobalAlloc, which merely disables Delphi's sub-allocator) ? If so, and if the VC++ DLL doesn't include function such as you could call for example vc_free( ), that in turn would call MS-VC++'s free( ), is the only solution (unless the VC++ can be changed), to write a small VC++ DLL including only something like vc_free( ), and does even that work ? please post answers to comp.lang.pascal.delphi.misc, if possible. Thanks !
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads