digitalmars.D.learn - Question about DLLs & implib
- John Kiro (13/13) Jan 29 2007 Hi There
 - Mike Parker (2/18) Jan 30 2007 extern(Windows)
 - John Kiro (1/1) Jan 30 2007 I'm using "extern(Windows)" already.
 - Carlos Santander (7/25) Jan 31 2007 If you're talking about DLLs that come with Windows, I remember some of ...
 
Hi There I have a DLL containing functions having stdcall calling convention. In order to be able to call these functions from inside a D-language program, I tried to create an import lib for the DLL using implib.exe. But the problem is that implib.exe neglects the calling convention of the functions, i.e. doesn't take into account the name decoration, so the linker does not find them. The only solution I see is to use the "C" calling convention instead, and use the option /s (or /system) with implib.exe: implib.exe /system mydll.lib mydll.dll So is there a way to use the stdcall convention instead? Thanks in advance john
 Jan 29 2007
John Kiro wrote:
 Hi There
 
 I have a DLL containing functions having stdcall calling convention.
 In order to be able to call these functions from inside a D-language
 program, I tried to create an import lib for the DLL using implib.exe.
 But the problem is that implib.exe neglects the calling convention of
 the functions, i.e. doesn't take into account the name decoration, so
 the linker does not find them.
 
 The only solution I see is to use the "C" calling convention instead,
 and use the option /s (or /system) with implib.exe:
 
    implib.exe /system mydll.lib mydll.dll
 
 So is there a way to use the stdcall convention instead?
 
extern(Windows)
 Jan 30 2007
John Kiro escribió:
 Hi There
 
 I have a DLL containing functions having stdcall calling convention.
 In order to be able to call these functions from inside a D-language
 program, I tried to create an import lib for the DLL using implib.exe.
 But the problem is that implib.exe neglects the calling convention of
 the functions, i.e. doesn't take into account the name decoration, so
 the linker does not find them.
 
 The only solution I see is to use the "C" calling convention instead,
 and use the option /s (or /system) with implib.exe:
 
    implib.exe /system mydll.lib mydll.dll
 
 So is there a way to use the stdcall convention instead?
 
 Thanks in advance
 john
If you're talking about DLLs that come with Windows, I remember some of the 
symbols would be stdcall and others would be C (even in the same DLL), so that 
might be the case with you right now. Maybe you can use "lib -l" (IIRC) to
check 
how each name is mangled?
-- 
Carlos Santander Bernal
 Jan 31 2007








 
 
 
 John Kiro <johnkirollos yahoo.com> 