The c++ callback USES the sink example
- 2020-04-02 02:14:37
- OfStack
// cbBysink.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "cbBysink.h"
class CMyWork : public baseCallBack
{
public:
CMyWork()
{
//Register callback
CWork::registercallback(this);
}
//Callback registration implementation
void CallbackFunction(int a, int b)
{
cout << "a = " << a << ",b = " << b << "n" << endl;
return;
}
//Triggered the callback
void makefunction(int a, int b)
{
CWork::makecallback(a, b);
return;
}
protected:
private:
};
int main(int argc, char* argv[])
{
CMyWork c_mywork;
//Dynamic registration is not required when triggering
c_mywork.makefunction(5, 6);
return 0;
}