Created
May 18, 2012 22:11
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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