Skip to content

Instantly share code, notes, and snippets.

@gokmen
Created May 18, 2012 22:11
Show Gist options
  • Save gokmen/2727850 to your computer and use it in GitHub Desktop.
Save gokmen/2727850 to your computer and use it in GitHub Desktop.
If you ever need a QApplication mainloop in a DLL u can use following header concept for your DLL.
static QApplication* app;
static int argc = 0;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
{
app = new QApplication(argc, NULL);
break;
}
case DLL_PROCESS_DETACH:
{
delete app;
break;
}
}
return(TRUE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment