Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How can I cast or convert boost bind to C function pointer?
  2. void func(WCHAR* pythonStatement) {
  3.   // Do something with pythonStatement
  4. }
  5.        
  6. bind(func, TEXT("console.write('test')"))
  7.        
  8. typedef void (__cdecl * PFUNCPLUGINCMD)();
  9.  
  10. struct FuncItem {
  11. PFUNCPLUGINCMD pFunc;
  12.     // ...
  13. };
  14.        
  15. void uglyWorkaround() {
  16.     globalLambdaFunctor();
  17. }
  18.        
  19. void wrapper() {
  20.     func(TEXT("console.write('test')"));
  21. }