Now why doesn't this COMPILE!?!?!?
-
Hi, I've been staring at this problem for hours and hours... what is wrong?! This is what I do:
...snip...
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_Lex, CLex)
END_OBJECT_MAP()/////////////////////////////////////////////////////////////////////////////
// DLL Entry Pointextern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
TCHAR pszLoader[MAX_PATH];
GetModuleFileName(NULL, pszLoader, MAX_PATH);
_tcslwr(pszLoader);
if (_tcsstr(pszLoader, _T("explorer.exe")))
return FALSE;\_Module.Init(ObjectMap, hInstance, &LIBID\_LEXBHOLib); DisableThreadLibraryCalls(hInstance); } else if (dwReason == DLL\_PROCESS\_DETACH) \_Module.Term(); return TRUE; // ok
}
...snap...
I get this error:
---Configuration: LexBHO - Win32 Unicode Release MinDependency--------
Linking...
Creating library ReleaseUMinDependency/LexBHO.lib and object ReleaseUMinDependency/LexBHO.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseUMinDependency/LexBHO.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.LexBHO.dll - 2 error(s), 0 warning(s)
But when I comment these lines out...
/*
TCHAR pszLoader[MAX_PATH];
GetModuleFileName(NULL, pszLoader, MAX_PATH);
_tcslwr(pszLoader);
if (_tcsstr(pszLoader, _T("explorer.exe")))
return FALSE;
*/...things are working just fine. What is wrong with _tcslwr? Because that's where the problems start... Help is much appreciated, /Tommy
-
Hi, I've been staring at this problem for hours and hours... what is wrong?! This is what I do:
...snip...
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_Lex, CLex)
END_OBJECT_MAP()/////////////////////////////////////////////////////////////////////////////
// DLL Entry Pointextern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
TCHAR pszLoader[MAX_PATH];
GetModuleFileName(NULL, pszLoader, MAX_PATH);
_tcslwr(pszLoader);
if (_tcsstr(pszLoader, _T("explorer.exe")))
return FALSE;\_Module.Init(ObjectMap, hInstance, &LIBID\_LEXBHOLib); DisableThreadLibraryCalls(hInstance); } else if (dwReason == DLL\_PROCESS\_DETACH) \_Module.Term(); return TRUE; // ok
}
...snap...
I get this error:
---Configuration: LexBHO - Win32 Unicode Release MinDependency--------
Linking...
Creating library ReleaseUMinDependency/LexBHO.lib and object ReleaseUMinDependency/LexBHO.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseUMinDependency/LexBHO.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.LexBHO.dll - 2 error(s), 0 warning(s)
But when I comment these lines out...
/*
TCHAR pszLoader[MAX_PATH];
GetModuleFileName(NULL, pszLoader, MAX_PATH);
_tcslwr(pszLoader);
if (_tcsstr(pszLoader, _T("explorer.exe")))
return FALSE;
*/...things are working just fine. What is wrong with _tcslwr? Because that's where the problems start... Help is much appreciated, /Tommy