Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
f.vanalmetelevic.com last edited by
I'm currently adding voip-functionality to our Qt based application. This is a C-library that uses callback functionality to report back status information. I wonder what would be the best practice to get this in Qt code ? I assume I can't pass a class member function as a callback funtion pointer. I tried to set the class member function to static, but I get an error when building.
Do I have to mix C-code and C++ code to make this work ?
Any example would be great.
Thanks in advance.
maciej last edited by
Check this out: http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html
cincirin last edited by
If your static class member function match the declaration of your C library callback, then there should be no problem in your code.
Franzk last edited by
[quote author="cincirin" date="1306334700"]If your static class member function match the declaration of your C library callback, then there should be no problem in your code.[/quote]
As stated in the cpp faq, this includes the calling convention (cdecl, stdcall, that sorta thing).