qint32 ClassD
::connectToServer(QString IP, qint32 port
){
qDebug() << "connectToServer";
client = new CCltClient(this);
connect(client, SIGNAL(signalConnectedToServer()), this, SLOT(slotConnectedToServer()));
if (!client->connectToServer(IP, port))
{
return FORMAT_ERROR;
}
return OK;
}
void ClassD::slotConnectedToServer()
{
qDebug() << "slotConnectedToServer";
}
void Thread::close()
{
emit Kill_me();
}
void Thread::run()
{
qDebug("run");
if (!qApp)
{
qDebug("no application running");
int argc = 1;
char *argv[] =
{ "setup", NULL };
a.connect(this, SIGNAL(Kill_me()), &a, SLOT(quit()));
qDebug("start running");
a.exec();
qDebug("application end");
}
}
static ClassD *pToFunc;
Thread t;
extern "C" __declspec(dllexport) int func1(void)
{
t.start();
pToFunc = new ClassD();
return pToFunc->connectToServer("127.0.0.1", 9190);
}