Article View: borland.public.cppbuilder.nativeapi
Article #11186Run Time Dynamic linking
From: peter
Date: Thu, 19 Feb 2004 15:33
Date: Thu, 19 Feb 2004 15:33
27 lines
1826 bytes
1826 bytes
ok, so I think my earlier post was a bit confusing. Here is a more
straightforward question:
I have a DLL called NYSiteP.dll with an exported function called
'SITE' that recieves 2 'char *' parameters. I need to load this
function at run-time. How do I properly use the 'LoadLibrary' and
'GetProcAddress' API functions to pull this off? The MSDN example,
of course, not very thorough or explanatory. I have this code:
Lib = LoadLibrary("NYSiteP.dll");
if (Lib != NULL)
{
Proc = (MYPROC) GetProcAddress(Lib, "SITE");
if (NULL != Proc){
fRunTimeLinkSuccess = TRUE;
(Proc) ( szRunTypes,(char *)&rntyptable);
}//end if
fFreeResult = FreeLibrary(Lib);
However, this won't compile because it says I have an extra
parameter. For some reason, the compiler sees the definition of
'Proc' as VOID (*)(*char), which is not right, and I don't know
how to correct that to the proper definition of int (char *,char *)
in the eyes of the compiler. Thanks
Technical Details
Message-ID:
<4034d732$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c9838237a73aa85e,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-19 07:40:33 PST From: "peter" <peterna@attglobal.net> Sender: "peter" <peterna@attglobal.net> Reply-To: "peter" <peterna@attglobal.net> Subject: Run Time Dynamic linking Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 66.88.112.2 NNTP-Posting-Host: 207.105.83.66 Message-ID: <4034d732$1@newsgroups.borland.com> Date: 19 Feb 2004 07:33:06 -0800 X-Trace: newsgroups.borland.com 1077204786 207.105.83.66 (19 Feb 2004 07:33:06 -0800) Lines: 27 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail