What's the difference in calling a function in the following ways:
The first way to create a thread. Example:
DWORD WINAPI Metodo1(LPVOID)
{
// Meu código aqui...
return NULL;
}
int WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL, NULL, &Metodo1, NULL, NULL, NULL);
break;
}
return true;
}
Second way calling directly on Main. Example:
void Metodo2(void)
{
// Meu código...
}
int WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
Metodo2();
break;
}
return true;
}