使用WndClass读取位置时发生访问冲突
Access violation reading location using WndClass
我有一个问题,使用以下代码:
BOOL RegisterApp(HINSTANCE hInst)
{
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wc.lpszClassName = szClassName;
//
//
return RegisterClass(&wc);
}
当我尝试使用&wc
时,我会出现以下错误:
Unhandled exception at 0x763adf81 in lab3.exe: 0xC0000005: Access violation reading location 0xcccccccc.
请帮帮我,我该怎么办?
您尚未初始化wc的所有数据成员。
请参阅http://msdn.microsoft.com/en-us/library/windows/desktop/ms633576(v=vs.85).aspx
相关文章:
- 写入位置0x0000000C时发生访问冲突
- 0xC0000005:访问冲突写入位置0xCDCDCDCD动态分配错误
- 0xC0000005:访问冲突读取位置 0x00000000. 重载 == 运算符的问题
- (此函数用于计算 SMA).在 FA.exe 中0x00509159引发异常: 0xC0000005:访问冲突读取位置0
- 0xC0000005:读取位置0xCDCDCDC1时发生访问冲突
- 0xC0000005:读取位置0xCDCDCDCD时发生访问冲突
- 读取类的析构函数中的位置时发生访问冲突
- 在尝试使用CUDA分配内存时,我遇到了访问冲突写入位置错误
- 创建 2D 数组0xCCCCCCCC访问冲突写入位置
- 0x0F50DF58:0xC0000005:访问冲突读取位置0x0047CA04时未处理的异常
- 在 DLL 中嵌入 Python:Py_DECREF列表对象时访问冲突读取位置
- 在 C 代码中调用 Python 函数时第三次出现访问冲突写入位置错误
- 0xC0000005:访问冲突读取位置0x0000000000000008
- 使用动态数组访问冲突写入位置
- C++访问冲突读取位置0xDDDDDDCD当我尝试删除已更新的数组时
- 使用向量的函数崩溃,调试器说访问冲突读取位置
- vc++ 访问冲突读取位置
- C++ - 智能指针 - 访问冲突读取位置0xDDDDDDDD
- C++访问冲突读取位置错误
- 调用隔离后访问冲突执行位置0x0000000000000000:New()