td
7th April 2010, 11:06
Hi guys,
I have a widget that uses QLibrary to load a DLL and resolve its functions into widget specified functions. Here's what I mean
myWidget::myWidget(QWidget *parent)
: QWidget(parent)
{
myLib = new QLibrary; // library to hold DLL
}
void myWidget::openDLL(QString DLL_File_Name)
{
bool operation;
typedef bool (*MyPrototypeOne)();
MyPrototypeOne Open = (MyPrototypeOne) myLib->resolve("OD");
operation = Open();
emit Success(operation);
}
void myWidget::run(QString DLL_File_Name)
{
typedef int (*MyPrototypeTwo)();
MyPrototypeTwo RunFunc = (MyPrototypeTwo) myLib->resolve("RF");
int i = RunFunc();
}
What I want to know is, is it possible to have these resolved functions accessible throughout the widget? It would be nice not to have to continually pass the file name and prototype the function but rather resolve it once and have it accessible everywhere.
Any help appreciated.
I have a widget that uses QLibrary to load a DLL and resolve its functions into widget specified functions. Here's what I mean
myWidget::myWidget(QWidget *parent)
: QWidget(parent)
{
myLib = new QLibrary; // library to hold DLL
}
void myWidget::openDLL(QString DLL_File_Name)
{
bool operation;
typedef bool (*MyPrototypeOne)();
MyPrototypeOne Open = (MyPrototypeOne) myLib->resolve("OD");
operation = Open();
emit Success(operation);
}
void myWidget::run(QString DLL_File_Name)
{
typedef int (*MyPrototypeTwo)();
MyPrototypeTwo RunFunc = (MyPrototypeTwo) myLib->resolve("RF");
int i = RunFunc();
}
What I want to know is, is it possible to have these resolved functions accessible throughout the widget? It would be nice not to have to continually pass the file name and prototype the function but rather resolve it once and have it accessible everywhere.
Any help appreciated.