Article View: borland.public.cppbuilder.nativeapi
Article #12081Re: GetProcAddress return type
From: Bob Gonder
Date: Thu, 25 Dec 2003 07:32
Date: Thu, 25 Dec 2003 07:32
24 lines
2013 bytes
2013 bytes
On Thu, 25 Dec 2003 01:10:44 -0500, you wrote:
Hmmm... somehow I emailed this to you instead of posting, sorry 'bout
that.
>It doesn't work - vs gets NULL value, although "_VPNStart" shows when i
>dump the DLL.
You might find it usefull to follow the advice in the help:
If the function fails, the return value is NULL. To get extended error
information, call GetLastError.
Then, you can use the following to change the number into English:
void _stdcall ErrorBox(DWORD errorcode,LPCTSTR titl)
{ VOID* lpBuffer;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER+FORMAT_MESSAGE_FROM_SYSTEM+70,
NULL,errorcode,0,(char*)&lpBuffer,0,NULL);
MessageBox( hWnd, (char*)lpBuffer, titl,
MB_OK|MB_ICONINFORMATION|MB_TOPMOST );
LocalFree( lpBuffer );
}
As in ErroxBox( GetLastError(),"GetProcAddress for VPNStart");
Technical Details
Message-ID:
<ch4luvkss29rqjpa3eikdot6bjt8ssmt7g@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!easynet-monga!easynet.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!newspeer.lavaseals.co.uk!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fea7f6e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,3d934f741828d59c X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-24 23:39:12 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: GetProcAddress return type Date: Wed, 24 Dec 2003 23:32:37 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <ch4luvkss29rqjpa3eikdot6bjt8ssmt7g@4ax.com> References: <3fea7f6e$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.244.13.96 X-Trace: newsgroups.borland.com 1072337557 216.244.13.96 (24 Dec 2003 23:32:37 -0700) Lines: 26 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!easynet-monga!easynet.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!newspeer.lavaseals.co.uk!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail