Re: DLL function loading issue
- From: --== Alain ==-- <nospam@xxxxxxxxxxx>
- Date: Sat, 30 Sep 2006 21:04:44 +0200
Sorry but it did not change anything.
it seems that issue is with static keyword... i do not understand why, but it is not with __stdcall.
Al.
Abdo Haji-Ali wrote:
"--== Alain ==--" <nospam@xxxxxxxxxxx> wrote in message.
news:eBUQL1L5GHA.4196@xxxxxxxxxxxxxxxxxxxxxxx
Here is an updated version of my code with typedef and the relative errors:// --- myclass.hFrom MSDN:
typedef LPTSTR (__stdcall *FUNCT_LocGetString)(long);
"/Gd, the default setting, specifies the C calling convention for all
functions except C++ member functions and functions marked __stdcall or
__fastcall."
So unless you changed the compiler options or specified __stdcall in the
declaration of your function you're most likely to get a runtime error
<code sniped>
VC raises following errors :This has nothing to do with the function pointer nor the function itself,
CARDLLWrapper.obj : error LNK2001: unresolved external symbol "private:
static char * (__stdcall* CARDLLWrapper::LocGetString)(long)"
(?LocGetString@CARDLLWrapper@@0P6GPADJ@ZA)
CARDLLWrapper.obj : error LNK2001: unresolved external symbol "private:
static struct HINSTANCE__ * CARDLLWrapper::m_hlibLoc"
(?m_hlibLoc@CARDLLWrapper@@0PAUHINSTANCE__@@A)
but rather with the declaration of the static variable inside the class.
From what I can see this varaible isn't "defined" anywhere. So what you need
to do is to define it somewhere (in one of your source files) exacly once
(Much like a function: It has a declaration and a definition). Your
definition should look something like this:
FUNCT_LocGetString CARDLLWrapper::LocGetString; // Possibly with
initialization
- Follow-Ups:
- Re: DLL function loading issue
- From: eit
- Re: DLL function loading issue
- From: Abdo Haji-Ali
- Re: DLL function loading issue
- References:
- DLL function loading issue
- From: --== Alain ==--
- Re: DLL function loading issue
- From: Abdo Haji-Ali
- Re: DLL function loading issue
- From: Igor Tandetnik
- Re: DLL function loading issue
- From: Abdo Haji-Ali
- Re: DLL function loading issue
- From: --== Alain ==--
- Re: DLL function loading issue
- From: Abdo Haji-Ali
- DLL function loading issue
- Prev by Date: Re: VC++2005 executables much slower than VC++6????
- Next by Date: Re: LPCTSTR to std::string
- Previous by thread: Re: DLL function loading issue
- Next by thread: Re: DLL function loading issue
- Index(es):
Relevant Pages
|