|
楼主 |
发表于 2020-12-20 07:45:01
|
显示全部楼层
是我的错我没有说清楚,在OnGetData()里面的TRACE是执行过的,在执行了这个TRACE理论上是应该再执行WaitForSingleObject()后面的TRACE但是没有,程序debug跳出个assert来,现场的call stack如下:
CMapPtrToPtr::GetValueAt(void * 0x002602de) line 186 + 9 bytes
CHandleMap::LookupPermanent(void * 0x002602de) line 90 + 19 bytes
CWnd::AssertValid() line 894 + 15 bytes
CView::AssertValid() line 495
CFormView::AssertValid() line 278
CEcmRecordView::AssertValid() line 62
AfxAssertValidObject(const CObject * 0x003d63a0 {CEcmRecordView}, const char
* 0x5f4d1700 THIS_FILE, int 939) line 108
CDocument::AssertValid() line 940
CEcmUIDoc::AssertValid() line 109
AfxAssertValidObject(const CObject * 0x003d5d88 {CEcmUIDoc}, const char * 0x
5f4d1744 THIS_FILE, int 425) line 108
CDocTemplate::AssertValid() line 426
CMultiDocTemplate::AssertValid() line 220
AfxAssertValidObject(const CObject * 0x003d4a38 {CMultiDocTemplate}, const c
har * 0x5f4d17e0 THIS_FILE, int 852) line 108
CDocManager::AssertValid() line 853
AfxAssertValidObject(const CObject * 0x003d4b98 {CDocManager}, const char *
0x5f4d1a38 THIS_FILE, int 551) line 108
CWinApp::AssertValid() line 552
AfxAssertValidObject(const CObject * 0x00424978 class CEcmUIApp theApp, cons
t char * 0x5f4d19e8 THIS_FILE, int 537) line 108
CWinThread::OnIdle(long 0) line 541
CWinApp::OnIdle(long 0) line 479
CWinThread::Run() line 479 + 30 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x0014
1efa, int 1) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141ef
a, int 1) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c816fd7()
上面是call stack中的提示,下面是CMapPtrToPtr()的代码和出错的地方:
void* CMapPtrToPtr::GetValueAt(void* key) const
// find value (or return NULL -- NULL values not different as a result)
{
if (m_pHashTable == NULL)
return NULL;
UINT nHash = HashKey(key) % m_nHashTableSize;
// see if it exists
CAssoc* pAssoc;
for (pAssoc = m_pHashTable[nHash]; pAssoc != NULL; pAssoc = pAssoc->pNext)
// assert here
{
if (pAssoc->key == key)
return pAssoc->value;
}
return NULL;
}
谢谢大家的关注,帮我想想吧,集思广意 |
|