dllmain.cpp :
#include <Windows.h>
#include <QApplication>
#include "AppThread.h"
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hModule);
AppThread * thread = new AppThread();
thread->start();
}
return TRUE;
}
#include <Windows.h>
#include <QApplication>
#include "AppThread.h"
BOOL APIENTRY DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hModule);
AppThread * thread = new AppThread();
thread->start();
}
return TRUE;
}
To copy to clipboard, switch view to plain text mode
AppThread.h:
#ifndef APPTHREAD_H
#define APPTHREAD_H
#include <QThread>
#include <QApplication>
#include <QMessageBox>
#include "TestUI.h"
{
int result;
void run()
{
int a = 0;
TestUI w;
w.show();
result = myQapp.exec();
}
public:
AppThread() {}
};
#endif // APPTHREAD_H
#ifndef APPTHREAD_H
#define APPTHREAD_H
#include <QThread>
#include <QApplication>
#include <QMessageBox>
#include "TestUI.h"
class AppThread : public QThread
{
int result;
void run()
{
int a = 0;
QApplication myQapp(a, NULL);
TestUI w;
w.show();
result = myQapp.exec();
}
public:
AppThread() {}
};
#endif // APPTHREAD_H
To copy to clipboard, switch view to plain text mode
Bookmarks