创建类函数宏

时间:2018-03-23 08:04:05

标签: c++ winapi

我想知道是否有更简单的方法在我的班级中创建虚拟函数,然后是一个宏来调用它们。

        virtual int Controller::OnClose(WPARAM wParam, LPARAM lParam, bool& bHandled) { return 0; }
        virtual int Controller::OnDestroy(WPARAM wParam, LPARAM lParam, bool& bHandled) { return 0; }
        virtual int Controller::OnPaint(WPARAM wParam, LPARAM lParam, bool& bHandled) { return 0; }

        case WM_CREATE:         lRes = OnCreate(wParam, lParam, bHandled);      break;
        case WM_DESTROY:        lRes = OnDestroy(wParam, lParam, bHandled);     break;
        case WM_PAINT:          lRes = OnPaint(wParam, lParam, bHandled);       break;

0 个答案:

没有答案