Hi there,

The PyQt docs for QLibrary include the following common-usage snippet:

Qt Code:
  1. QLibrary myLib("mylib");
  2. typedef void (*MyPrototype)();
  3. MyPrototype myFunction = (MyPrototype) myLib.resolve("mysymbol");
  4. if (myFunction)
  5. myFunction();
To copy to clipboard, switch view to plain text mode 

That is not terribly useful, as is, within Python. What I'm wondering is what the Python equivalent would be? This is what I've tried:

Qt Code:
  1. def getKeyboardHooks(self):
  2. kcLib = QLibrary('path\to\my.dll')
  3. f = kcLib.resolve('installhook')
  4. if not f:
  5. print 'DEBUG: no resolve() installhook', kcLib.errorString()
  6. else:
  7. print 'DEBUG:', f
  8. try:
  9. f(self.winId())
  10. except Exception as (errstr):
  11. logger.exception(errstr)
To copy to clipboard, switch view to plain text mode 

On STDOUT I get the else print statement, and the log file gets the following exception: "TypeError: 'sip.voidptr' object is not callable". It seems I need the Python equivalent of a typedef cast but I have no idea how to do this. Web searches on Python typedef and sip.voidptr have yielded very little information, although there is a sip.cast(obj, type) method that looks promising? I don't know. Thanks in advance to any PyQt coders who respond.