|
发表于 2020-11-27 08:57:18
|
显示全部楼层
本帖最后由 xieglt 于 2020-11-27 08:59 编辑
- #include <iostream.h>
- class test
- {
- public:
- test();
- ~test();
- public:
- static void _stdcall a(void * t);
- void b(void (_stdcall * Function)(void *));
- private:
- void c(void);
- };
- test::test()
- {
- }
- test::~test()
- {
- }
- void test::a(void * t)
- {
- test * p = reinterpret_cast<test *>(t);
- p->c();
- }
- void test::b(void (_stdcall * Function)(void *))
- {
- Function(this);
- }
- void test::c()
- {
- cout << "This is a callback function!";
- }
- int main()
- {
- test t;
- t.b(test::a);
- return 0;
- }
复制代码 |
|