Problem: Using _beginthreadex in DllMain

I want to spawn a thread with _beginthreadex in my Dll,but it doesnt work.

the code :

// ThreadFunc

unsigned __stdcall ThreadFunc( void* pArguments )
{

MessageBox(NULL, L"yanxizhen Test", L"Test", MB_OK);

_endthreadex( 0 );
return 0;
}

//
// DllMain
//
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{

switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
_beginthreadex(NULL, 0, &ThreadFunc, NULL, 0, 0);
break;
}
return TRUE;
}

Thanks!



Answer this question

Problem: Using _beginthreadex in DllMain

  • Vijay197886859

    I found why.............LoL..........
  • Problem: Using _beginthreadex in DllMain