Re: Threading issue in DLL
Static build will probably not allow you to load a dynamic library.
Re: Threading issue in DLL
Hi,
The DLL is loaded alright, I'm able to call functions getConst and getCounter in IBHandler, when it is loaded.
But the mainloop in IBHandler is not running.
Code:
#include "ibkernel.h"
IBKernel
::IBKernel(QObject *parent
) :{
}
IBKernel::~IBKernel()
{
}
IBHandler* IBKernel::getHandler()
{
return handler;
}
void IBKernel::startKernel()
{
exec();
}
void IBKernel::stopKernel()
{
quit();
}
void IBKernel::run()
{
handler = new IBHandler();
//handler->moveToThread(this);
QTimer::singleShot(10, handler,
SLOT(MainLoop
()));
exec();
delete handler;
handler = 0;
}
Code:
#include "ibhandler.h"
IBHandler
::IBHandler(QObject *parent
) :{
mainLoopCnt = 30;
}
IBHandler::~IBHandler()
{
}
int IBHandler::getCounter()
{
return mainLoopCnt;
}
int IBHandler::getConst()
{
return 99;
}
void IBHandler::MainLoop()
{
// THIS STOPS or NEVER STARTS in the static released version
mainLoopCnt++;
QTimer::singleShot(0,
this,
SLOT(MainLoop
()));
}
Re: Threading issue in DLL
have you statically built qt libraries as well?
Re: Threading issue in DLL
Hi,
Yep! - All libs statically build. And used to build both the TestLibTest application and the DLL
Re: Threading issue in DLL
Problem found!
In standalone mode the DLL seems to need a QCoreApplication for the QTimer to work
Thanks anyway
Re: Threading issue in DLL
In any configuration QCoreApplication is needed for timers to work.