As shown in the above, the inline void callbackFunction1 (char * buffer, int Width1, int Height1, int nFrameNum1) as defined in the DLL external callback function, int a=InitLineCam (1, "192.168.3.50", "192.168.3.21", "192.168.3.50", "192.168.3.21", & amp; CallbackFunction1, & amp; CallbackFunction2, & amp; CallbackFunction11, & amp; CallbackFunction22); For DLL API function, originally want to function inline void callbackFunction1 put inside class, is the front and scope into void QThikDLLTest: : callbackFunction1, but this will be an error when call, put him in the above definition is not an error, but it couldn't get back to data BYTE * m_pBuffer DiaoHan digital back to internal to deal with, want to ask me how to do this is the right thing, how to BYTE * m_pBuffer data to QThikDLLTest this class within the global variable to use!! Show just a little, a great god
CodePudding user response:
I tell god genuflect is begged, thank you!!!!!!!!!!!!!!! 1CodePudding user response:
Describe the mess, don't know whether understand what you mean,The callback function with an argument? Parameter type is a class a pointer,
Or search: c + + class member function as a callback function
CodePudding user response:
Thought the function inline void callbackFunction1 put inside class, is the front and scope into void QThikDLLTest: : callbackFunction1, but this would be an error in the call??????CallbackFunction1 statement for static function
CodePudding user response:
The callback function is added a QThikDLLTest * parameter, the callback will be used when m_pBuffer content copied to the pointer to the variable data to store