此帖出自嵌入式系统论坛
最新回复
谢谢指点
我看了下wincore.cpp文件1051行
void CWnd::AssertValid() const
{
if (m_hWnd == NULL)
return; // null (unattached) windows are valid
// check for special wnd??? values
ASSERT(HWND_TOP == NULL); // same as desktop
if (m_hWnd == HWND_BOTTOM)
ASSERT(this == &CWnd::wndBottom);
else if (m_hWnd == HWND_TOPMOST)
ASSERT(this == &CWnd::wndTopMost);
else if (m_hWnd == HWND_NOTOPMOST)
ASSERT(this == &CWnd::wndNoTopMost);
else
{
// should be a normal window
ASSERT(::IsWindow(m_hWnd));
// should also be in the permanent or temporary handle map
CHandleMap* pMap = afxMapHWND();
ASSERT(pMap != NULL);
CObject* p;
ASSERT((p = pMap->LookupPermanent(m_hWnd)) != NULL ||
(p = pMap->LookupTemporary(m_hWnd)) != NULL);/////LINE1051
ASSERT((CWnd*)p == this); // must be us
// Note: if either of the above asserts fire and you are
// writing a multithreaded application, it is likely that
// you have passed a C++ object from one thread to another
// and have used that object in a way that was not intended.
// (only simple inline wrapper functions should be used)
//
// In general, CWnd objects should be passed by HWND from
// one thread to another. The receiving thread can wrap
// the HWND with a CWnd object by using CWnd::FromHandle.
//
// It is dangerous to pass C++ objects from one thread to
// another, unless the objects are designed to be used in
// such a manner.
}
}
看到了NOTE,我的程序是多线程同步,简单描述下:
DWORD WINAPI CCHQThreadDlg::ReadThread1(LPVOID lpvoid)//建立了线程1
CWork DlgWork;DlgWork.DoModal();//在线程1中弹出对话框 报错
大虾能简单解释下上面的NOTE吗?是不是我的对话框被多个线程占用?但是在程序里没有阿
详情
回复
发表于 2007-4-5 11:30
| ||
|
||
| |
|
|
此帖出自嵌入式系统论坛
| ||
|
||
EEWorld Datasheet 技术支持