0x004048dc 处未处理的错误: 0xC0000005: 读取位置 0x00000020 时发生访问冲突
0x004048dc 处未处理的异常: 0xC0000005: 读取位置 0x00000020 时发生访问冲突
Chat.exe 中的 0x004048dc 处未处理的异常: 0xC0000005: 读取位置 0x00000020 时发生访问冲突
错误在::PostMessage(AfxGetMainWnd()->m_hWnd,UM_ONLINE_CHANGE,0,0);
其中UM_ONLINE_CHANGE 是#define UM_ONLINE_CHANGE WM_USER+4
怎么解决
------解决方案--------------------
AfxGetMainWnd()->m_hWnd??这个值有效吗????
------解决方案--------------------
AfxGetMainWnd()->m_hWnd这个变量是安全的吗?
------解决方案--------------------
If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call.
------解决方案--------------------
AfxGetMainWnd() 的返回值为 NULL
验证代码:
int k = (int)(&(((CWnd*)NULL)->m_hWnd));
k 的值就是 0x20
Chat.exe 中的 0x004048dc 处未处理的异常: 0xC0000005: 读取位置 0x00000020 时发生访问冲突
错误在::PostMessage(AfxGetMainWnd()->m_hWnd,UM_ONLINE_CHANGE,0,0);
其中UM_ONLINE_CHANGE 是#define UM_ONLINE_CHANGE WM_USER+4
怎么解决
------解决方案--------------------
AfxGetMainWnd()->m_hWnd??这个值有效吗????
------解决方案--------------------
AfxGetMainWnd()->m_hWnd这个变量是安全的吗?
------解决方案--------------------
If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call.
------解决方案--------------------
AfxGetMainWnd() 的返回值为 NULL
验证代码:
int k = (int)(&(((CWnd*)NULL)->m_hWnd));
k 的值就是 0x20