function in DLL
- From: --== Alain ==-- <nospam@xxxxxxxxxxx>
- Date: Sat, 30 Sep 2006 21:15:41 +0200
Hi,
I'm still working on my DLL and is function to extract strings from the stringtable stored in the DLL.
it looks like that :
// -- mydll.cpp
extern "C" __declspec(dllexport) LPTSTR GetString(int Index)
{
TCHAR res[2048];
::LoadString(GetModuleHandle(NULL),Index, res, sizeof(res)/sizeof(TCHAR));
LPTSTR Answer(res);
return((Answer));
}
// -- mydll.h
extern "C" __declspec(dllexport) LPTSTR GetString(int Index);
however, on code --> ::LoadString(GetModuleHandle(NULL),Index, res, sizeof(res)/sizeof(TCHAR));
res is always empty... i guess that issue is with getModuleHandle.
However, after reading some post on internet, it seems correct...so where is the mistake ?
thx,
Al.
.
- Follow-Ups:
- Re: function in DLL
- From: Alexander Grigoriev
- Re: function in DLL
- From: Alex Blekhman
- Re: function in DLL
- Prev by Date: Re: LPCTSTR to std::string
- Next by Date: Re: DLL function loading issue
- Previous by thread: DLL function loading issue
- Next by thread: Re: function in DLL
- Index(es):
Relevant Pages
|