多线程中遇到ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);怎么解决 XP下用VC开发的程序,在一个主线程调用3 个线程,线程之间要共享数据,结果总出现wincore.cpp line 980 ASSERT(pMap->LookupPermanent(hWndOrig) == NULL)错误,不知该怎么办,请高手指点! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我所有线程都使用工作线程,现在我胡View->Debug Windows->Call Stack跟踪后出现以下信息:memcpy( unsigned char * 0x01550074, unsigned char * 0x01579d24,unsigned long 4277075695) line 171CString::CopyBeforeWrite() line190+30 bytesCString::SetAt(int 42732,char 58) line 607TranslateCodeThread(void * 0x00fe0040) line 95_AfxThreadEntry(void * 0x0012f888) line112+13 bytesthreadstartex(void * 0x00cb2070) line212+13 bytesKERNEL32!7c80b683()光标出现在以下位置:0042DF23 因误操作以上问题没有写完:光标出现在以下位置:0042df23 rep movs dword ptr [edi],dword ptr [esi] 比如说CButton或者CDialog派生出来的类 是的,用CFormView中CListBox,那怎么改?现在出现以下错误:_free_dbg_lk(void * 0x00ca9fa0, int 1) line 1033 + 60 bytes_free_dbg(void * 0x00ca9fa0, int 1) line 970 + 13 bytesoperator delete(void * 0x00ca9fa0) line 351 + 11 bytesCString::FreeData() line 146 + 15 bytesCString::Release() line 157CString::operator=(const CString & {"GS0C4,GPSVST,07,{02,55,308,{44,00,00},00},{13,27,077,{39,00,00},00},{04,56,038,{45,00,00},00},{10,39,216,{38,00,00},00},{17,35,126,{42,00,00},00},{30,14,314,{39,00,00},00},{05,28,293,{38,00,00},00},@40$GNZDA,023901.00,28,03,2007,00,00*7DGS0C4,GPSVS") line 334TranslateCodeThread(void * 0x00fe0040) line 54_AfxThreadEntry(void * 0x0012f888) line 112 + 13 bytes_threadstartex(void * 0x00cb2070) line 212 + 13 bytesKERNEL32! 7c80b683() 先说一下可能的原因1。线程中使用了指向全局的DoModal对话框类,并在线程中试图销毁对话框对象,有可能导致,最好改成局部的。如果是派生类,在析构函数里设置m_hWnd=NULL;不知道你是怎样引用的CListBox,你可以贴出相关代码。线程里最好不要直接使用指针,可以把这些类的hwnd句柄传递进去,或者使用postmessage来与UI交互 我的视是基于CFormView,没有可析构函数在class CJavadView : public CFormView中定义CGCColorStatic m_GPSTime;CListBox m_ListTTS;CString FileHeader[19];在线程中使用UINT TranslateCodeThread(LPVOID pParam){ CJavadView *pView; pView=(CJavadView*)pParam; CString GPSStr,weekstr; GPSStr.Format(" %02d : %02d : %02d",hour,minute,second); pView->m_GPSTime.SetWindowText(GPSStr); for(i=0;i<19;i++) pView->m_ListTTS.AddString(pView->FileHeader[i])} 还出现以下错误:Debug Error!DAMAGE: after Normal block(#789630) at 0x00CA9FA0 如何创建多个窗口??? ********每天散20分,第10个人进来后结贴,为的是细水长流************** 如何为按钮载入图标或者位图? static变量赋初值出错 API编程:工具栏显示提示问题 CSplitterWnd的一个问题,大家帮个忙,谢谢 如何将 C++ 的字符串转化为 C# 中的 UNICODE 呢? 如何在程序中实现对工程的管理?请指教! 有关利用另外一个工程项目资源的问题,恳请指教,万分感谢!! 请问有图象处理相关的QQ群没? 我是做编译器和IDE的,发展前途在哪里? 串口通信界面的问题
CString::CopyBeforeWrite() line190+30 bytes
CString::SetAt(int 42732,char 58) line 607
TranslateCodeThread(void * 0x00fe0040) line 95
_AfxThreadEntry(void * 0x0012f888) line112+13 bytes
threadstartex(void * 0x00cb2070) line212+13 bytes
KERNEL32!7c80b683()光标出现在以下位置:
0042DF23
光标出现在以下位置:
0042df23 rep movs dword ptr [edi],dword ptr [esi]
现在出现以下错误:
_free_dbg_lk(void * 0x00ca9fa0, int 1) line 1033 + 60 bytes
_free_dbg(void * 0x00ca9fa0, int 1) line 970 + 13 bytes
operator delete(void * 0x00ca9fa0) line 351 + 11 bytes
CString::FreeData() line 146 + 15 bytes
CString::Release() line 157
CString::operator=(const CString & {"GS0C4,GPSVST,07,{02,55,308,{44,00,00},00},{13,27,077,{39,00,00},00},{04,56,038,{45,00,00},00},{10,39,216,{38,00,00},00},{17,35,126,{42,00,00},00},{30,14,314,{39,00,00},00},{05,28,293,{38,00,00},00},@40
$GNZDA,023901.00,28,03,2007,00,00*7D
GS0C4,GPSVS") line 334
TranslateCodeThread(void * 0x00fe0040) line 54
_AfxThreadEntry(void * 0x0012f888) line 112 + 13 bytes
_threadstartex(void * 0x00cb2070) line 212 + 13 bytes
KERNEL32! 7c80b683()
1。线程中使用了指向全局的DoModal对话框类,并在线程中试图销毁对话框对象,有可能导致,最好改成局部的。如果是派生类,在析构函数里设置m_hWnd=NULL;不知道你是怎样引用的CListBox,你可以贴出相关代码。线程里最好不要直接使用指针,可以把这些类的hwnd句柄传递进去,或者使用postmessage来与UI交互
在class CJavadView : public CFormView中定义
CGCColorStatic m_GPSTime;
CListBox m_ListTTS;
CString FileHeader[19];
在线程中使用
UINT TranslateCodeThread(LPVOID pParam)
{
CJavadView *pView;
pView=(CJavadView*)pParam; CString GPSStr,weekstr;
GPSStr.Format(" %02d : %02d : %02d",hour,minute,second);
pView->m_GPSTime.SetWindowText(GPSStr);
for(i=0;i<19;i++)
pView->m_ListTTS.AddString(pView->FileHeader[i])
}
Debug Error!DAMAGE: after Normal block(#789630) at 0x00CA9FA0