I got debug error when try to show simple widget subclass
inside dll

error
Qt Code:
  1. Debug Error
  2. QWidget:Cannot create a QWidget when no GUI is being used
To copy to clipboard, switch view to plain text mode 

How make GUI being used?

here simple test code.
Qt Code:
  1. QCoreApplication *coreApp ;
  2. void MyThread::run()
  3. {
  4.  
  5. int notUse;
  6. coreApp = new QCoreApplication(notUse,0);
  7.  
  8. QString fileName = qApp->applicationDirPath()+"/test.txt";
  9. qDebug(fileName.toLocal8Bit());
  10. //QFile file(fileName,coreApp);
  11. //file.open(QIODevice::ReadWrite);
  12. //file.write("Hello's world",sizeof("Hello's world"));
  13. MyGui gui;
  14. gui.show();
  15. coreApp->exec();
  16. }
  17.  
  18. BOOL APIENTRY DllMain( HMODULE hModule,
  19. DWORD ul_reason_for_call,
  20. LPVOID lpReserved
  21. )
  22. {
  23. switch (ul_reason_for_call)
  24. {
  25. case DLL_PROCESS_ATTACH:
  26. {
  27. MyThread *myThread = new MyThread;
  28. myThread->start();
  29. break;
  30. }
  31. case DLL_THREAD_ATTACH:
  32. case DLL_THREAD_DETACH:
  33. case DLL_PROCESS_DETACH:
  34. break;
  35. }
  36. return TRUE;
  37. }
To copy to clipboard, switch view to plain text mode 

Show gui at DLL_PROCESS_ATTACH
also got same debug message
Thank.