0

请帮帮我

class TLECustomControl
{
    private:
        ...
        HDC _hDC;
        HGLRC _hRC;
        void _stdcall MakeCurrent(void);
        void _stdcall GetSize(int* width, int* height);
    public:
        ...
        int Initialize(HWND handle);
};

void _stdcall TLECustomControl::MakeCurrent(void)
{
    wglMakeCurrent(this->_hDC, this->_hRC);
}

void _stdcall TLECustomControl::GetSize(int* width, int* height)
{
    this->MakeCurrent();
    int vPort[4];
    glGetIntegerv(GL_VIEWPORT, vPort);
    *width = vPort[2];
    *height = vPort[3];
}

int TLECustomControl::Initialize(HWND handle)
{
    ...
    //Create a custom buffer
    this->_customBuffer = LE::CreateCustomBuffer((byte*)this->GetSize,(byte*)this->MakeCurrent);
}

//错误列表

错误 2 错误 C2440: 'type cast' : 无法从 'void (__stdcall TLECustomControl::* )(void)' 转换为 'byte *' d:\leadwerks\projects\userwindow\LECustomControl.h

102 错误 1 ​​错误 C2440:“类型转换”:无法从“无效”转换

(__stdcall TLECustomControl::* )(int *,int *)' to 'byte *' d:\leadwerks\projects\userwindow\LECustomControl.h 101

4

1 回答 1

1

我猜是这条线

this->_customBuffer = LE::CreateCustomBuffer((byte*)this->GetSize,(byte*)this->MakeCurrent);

问题是您将成员函数作为参数传递,您实际上并没有调用GetSizeMakeCurrent函数。

但无论如何它都不起作用,因为这些函数都没有返回任何东西,但预期的参数是 type byte*

于 2013-11-06T06:30:01.510 回答