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

Qt Code:
  1. myWidget::myWidget(QWidget *parent)
  2. : QWidget(parent)
  3. {
  4. myLib = new QLibrary; // library to hold DLL
  5. }
  6.  
  7. void myWidget::openDLL(QString DLL_File_Name)
  8. {
  9. bool operation;
  10.  
  11. typedef bool (*MyPrototypeOne)();
  12. MyPrototypeOne Open = (MyPrototypeOne) myLib->resolve("OD");
  13.  
  14. operation = Open();
  15.  
  16. emit Success(operation);
  17.  
  18. }
  19.  
  20. void myWidget::run(QString DLL_File_Name)
  21. {
  22. typedef int (*MyPrototypeTwo)();
  23. MyPrototypeTwo RunFunc = (MyPrototypeTwo) myLib->resolve("RF");
  24.  
  25. int i = RunFunc();
  26. }
To copy to clipboard, switch view to plain text mode 

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.