文書番号: 401945
最終更新日: 2003/11/10
// 必要な typedef // typedef CVBControl* __based((__segment)_self)* FAR* CVBHandle; //CVBControl の派生クラス (この場合は CMyGrid) のメンバ関数として用意します// void CMyGrid::SubclassVBControl(CWnd* pParent, UINT idChild, BOOL bEmbedded) { ASSERT(pParent != NULL); ASSERT(idChild != 0 && idChild != -1); CMyGrid* pControl = (CMyGrid*)pParent->GetDlgItem(idChild); ASSERT(pControl->IsKindOf(RUNTIME_CLASS(CVBControl))); m_pModel = pControl->m_pModel; m_bRecreating = pControl->m_bRecreating; m_bInPostNcDestroy = pControl->m_bInPostNcDestroy; m_bLoading = pControl->m_bLoading; m_nCursorID = pControl->m_nCursorID; m_nInitialStack = pControl->m_nInitialStack; m_nRecursionLevel = pControl->m_nRecursionLevel; m_bStackFault = pControl->m_bStackFault; m_nFaultRecurse = pControl->m_nFaultRecurse; m_hbrBkgnd = pControl->m_hbrBkgnd; m_hFontCreated = pControl->m_hFontCreated; m_hcurMouse = pControl->m_hcurMouse; m_hCtl = pControl->m_hCtl; m_clrBkgnd = pControl->m_clrBkgnd; m_clrFore = pControl->m_clrFore; m_rectCreate = pControl->m_rectCreate; m_strTag = pControl->m_strTag; m_bAutoDelete = !bEmbedded; pControl->m_pModel = NULL; pControl->m_hCtl = NULL; CVBHandle hpControl = (CVBHandle) m_hCtl; **hpControl = this; pControl->m_hFontCreated=NULL; pControl->m_hbrBkgnd=NULL; pControl->m_hcurMouse=NULL; Attach(pControl->Detach()); if (pControl->m_bAutoDelete) delete pControl; }
Keywords: KBHOWTO VC10 KB401945
Technology: kbAudDeveloper kbVCsearch