上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 下一页
| { if (m_pWndCurrentChild-> IsKindOf(RUNTIME_CLASS(CMDIChildWnd))) { // CMDIChildWnd or a derived class. return (CMDIChildWnd*)m_pWndCurrentChild; } else { // Window is foreign to the MFC Framework. // Check the next window in the list recursively. return GetNextMDIChildWnd(); } } else { // Title window associated with an iconized child window. // Recurse over the window manager's list of Windows. return GetNextMDIChildWnd(); } } //----------------------------------------------------------------- // This function counts the number of CMDIChildWnd objects // currently maintained by the MDIClient. //----------------------------------------------------------------- int CMainFrame::GetCountCMDIChildWnds() { int count = 0; CMDIChildWnd* pChild = GetNextMDIChildWnd(); while (pChild) { count++; pChild = GetNextMDIChildWnd(); } return count; } |
问:为什么UI线程中执行pFrame->GetActiveDocument()语句会出错?
我的目的是希望再UI线程中调用主线程的一个函数。代码如下:
| CMainFrame* pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd; CHjysxtDoc* pDoc = (CHjysxtDoc*)pFrame->GetActiveDocument(); switch(pDoc->AddMubiao(mubiao)) 。。。 |
但执行时(CHjysxtDoc*)pFrame->GetActiveDocument();会报错。我怎样才能在我的UI线程中调用CHjysxtDoc中的AddMubiao()函数?
问:在工作线程中调用UpdateData()函数怎么抛出异常呢???
上一篇: ado方式访问带密码数据库的方法
下一篇: ADO 数据库连接
上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 下一页