将 void 转换为字节
Convert void to byte
请帮助我。
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:"类型转换":无法从"void"转换 (__stdcall TLECustomControl::* )(void)' 到 'byte *' d:\leadwerks\projects\userwindow\LECustomControl.h
102 错误 1 错误 C2440:"类型转换":无法从"void"转换
(__stdcall TLECustomControl::* )(int *,int *)' to 'byte *' d:\leadwerks\projects\userwindow\LECustomControl.h 101
我猜是这一行
this->_customBuffer = LE::CreateCustomBuffer((byte*)this->GetSize,(byte*)this->MakeCurrent);
问题是您将成员函数作为参数传递,实际上并没有调用GetSize
或MakeCurrent
函数。
但它无论如何都不起作用,因为这些函数都没有返回任何内容,但预期的参数是 byte*
型
相关文章:
- 如何在连接器 C++ 中将原始字节转换为字符串
- 将 char[] 数组转换为字节,然后将字节转换为 int,反之亦然
- 如何在 c++ 中将字节转换为 ASCII 十六进制表示形式?
- OPENSSL 将二进制字节转换为 SHA256 C++
- 如何将音频字节转换为样本
- C++ 如何将 char[] 中的多个字节转换为一个整数
- 删除字节转换的char*
- 如何将二进制字节转换为可打印的数值
- 将 MFRC522 UID 十六进制字节转换为可打印的小数
- 用c++将十六进制字符串切碎,并将中的每个字节转换为十进制
- Qt是否有一种将字节转换为int的方法,反之亦然
- UCS-4 到 Solaris 上的多字节转换
- 使用 C++ 将四个字节转换为整数
- 将字节转换为无符号整数的最快方法
- 如何在mac上将多字节转换为宽字符
- 将字节转换为整数
- 在Arduino错误时将4个字节转换为长字节
- 更正从C++到delphi AnsiString的字节转换
- 用C++将4个字节转换为3个字节
- 正在将字节转换为char数组,然后再转换回来