Article View: borland.public.cppbuilder.nativeapi
Article #16293Re: DLL GetProcAddress problem
From: Remy Lebeau (TeamB)
Date: Tue, 20 May 2003 17:21
Date: Tue, 20 May 2003 17:21
25 lines
1697 bytes
1697 bytes
"Enrico B." <eangelo@libero.it> wrote in message
news:3ec9e11d@newsgroups.borland.com...
> Txdevice_init = (int (*)(void))GetProcAddress(hndr, "Txdevice_init");
>
> always returns zero.
Your DLL function is not using the __stdcall convention, thus the actual
name exported from the DLL will be "_Txdevice_init" instead of
"Txdevice_init". I would suggest adding __stdcall:
--- DLL ---
extern "C" __declspec(dllexport) int __stdcall Txdevice_init();
--- Application ---
typedef int (__stdcall *DeviceInitPtr)();
DeviceInitPtr lpTxdevice_init = (DeviceInitPtr) GetProcAddress(hndr,
"Txdevice_init");
if( lpTxdevice_init )
lpTxdevice_init();
Gambit
Technical Details
Message-ID:
<3eca64ba$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!canoe.uoregon.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ec9e11d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,103aeaad97b09526 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-20 11:02:56 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ec9e11d@newsgroups.borland.com> Subject: Re: DLL GetProcAddress problem Date: Tue, 20 May 2003 10:21:11 -0700 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3eca64ba$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1053451450 207.175.226.26 (20 May 2003 10:24:10 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!canoe.uoregon.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail