F
FFrozTT
I have a small project that works fine as an EXE. Now I want to make
it into a DLL. I've created a DllMain routine and set it as the entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
HANDLE hThread = CreateThread(NULL,0,&ThreadProc,NULL,0,NULL);
CloseHandle(hThread);
}
return TRUE;
}
Any assistance would be greatly appreciated.
it into a DLL. I've created a DllMain routine and set it as the entry
point (code below). Then from DllMain I try to initialize my main
routine called ThreadProc. I've tryed this several different ways and
can't get it to work. It compiles fine but when I go rundll32
mydll.dll nothing happenes (works in exe form.)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call,
LPVOID lpReserved)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
HANDLE hThread = CreateThread(NULL,0,&ThreadProc,NULL,0,NULL);
CloseHandle(hThread);
}
return TRUE;
}
Any assistance would be greatly appreciated.