Callback function
-
Hi,
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.
Filip
-
Hi,
Check this out: http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html
-
[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).