Article View: borland.public.cppbuilder.nativeapi
Article #11312Loaded DLL function won't work
From: peter
Date: Wed, 18 Feb 2004 21:14
Date: Wed, 18 Feb 2004 21:14
30 lines
1766 bytes
1766 bytes
I am loading a function from a DLL called 'NYSiteP' at run-time.
The prototype is:
__declspec(dllexport)int __stdcall SITE ( char *Test, char *data)
I use LoadLibrary to load it, which executes fine and finds the
DLL without a hitch. However, it will not let me compile with the
correct amount of parameters. For instance, here is some code:
Lib = LoadLibrary("NYSiteP");
if (Lib != NULL)
{
Proc = (MYPROC) GetProcAddress(Lib, "SITE");
if (NULL != Proc){
(Proc) ( (char *)&rntyptable);
(Proc) ( (char *)&flformattable) ;
}//end if
this code compiles fine, but it does not have the right amount of
parameters. It passes this parameter to the 'Test' variable in
the SITE function. If I try to compile with this:
(Proc) (szRunTypes, (char *)&rntyptable);
which is how it ought to be, I get an 'extra parameter in call'
error. Does anyone know how I can remedy this? thanks
Technical Details
Message-ID:
<4033d5c9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!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,5a8f68731742a0dc X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-18 13:40:43 PST From: "peter" <peterna@attglobal.net> Sender: "peter" <peterna@attglobal.net> Reply-To: "peter" <peterna@attglobal.net> Subject: Loaded DLL function won't work Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 66.88.112.2 NNTP-Posting-Host: 207.105.83.66 Message-ID: <4033d5c9$1@newsgroups.borland.com> Date: 18 Feb 2004 13:14:49 -0800 X-Trace: newsgroups.borland.com 1077138889 207.105.83.66 (18 Feb 2004 13:14:49 -0800) Lines: 31 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail