🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16232

R: DLL GetProcAddress problem

#16232
From: Enrico B.
Date: Thu, 22 May 2003 10:35
33 lines
1893 bytes
Yes: "__stdcall" is requested.

Thank you Gambit

Remy Lebeau (TeamB) <gambit47@yahoo.com> wrote in message
3eca64ba$1@newsgroups.borland.com...
>
> "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: <3ecca40c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ec9e11d@newsgroups.borland.com> <3eca64ba$1@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-22 03:22:23 PST
Reply-To: "Enrico B." <eangelo@libero.it>
From: "Enrico B." <eangelo@libero.it>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ec9e11d@newsgroups.borland.com> <3eca64ba$1@newsgroups.borland.com>
Subject: R: DLL GetProcAddress problem
Date: Thu, 22 May 2003 12:35:44 +0200
Lines: 35
Organization: Idinet
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
NNTP-Posting-Host: 212.38.43.80
Message-ID: <3ecca40c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1053598732 212.38.43.80 (22 May 2003 03:18:52 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail