Unable to update DoDataExchange method : VS 2000 Project converted to Visual Studio 2008 or VS 2010
-
Hi, I am having a problem. I have a project "MicroSIP" which is used for SIP based call voice over IP. I am running it into VS 2010 and I need to customize it according to my need. For this as soon as I edit the main dialog ( Dialer ) and add some other controls ( like edit control of CEdit) and add member variable for from wizard of "Add Variable", it shows the message "unable to update DoDataExchange method". More over if getting reference of newly placed "Edit Control" in the program , it has NULL pointer or undefined reference. Anybody having any idea about this to resolve or some way around to resolve the issue. I am having extremely trouble for solving this scanario. Regards Usman Khalil
-
Hi, I am having a problem. I have a project "MicroSIP" which is used for SIP based call voice over IP. I am running it into VS 2010 and I need to customize it according to my need. For this as soon as I edit the main dialog ( Dialer ) and add some other controls ( like edit control of CEdit) and add member variable for from wizard of "Add Variable", it shows the message "unable to update DoDataExchange method". More over if getting reference of newly placed "Edit Control" in the program , it has NULL pointer or undefined reference. Anybody having any idea about this to resolve or some way around to resolve the issue. I am having extremely trouble for solving this scanario. Regards Usman Khalil
Sometimes the wizards get out of whack is some of the commented text that is in the header/source files is removed. Why not add the control by hand? It's really not that difficult. This is the problem with people using wizards... when they fail, you're left with no recourse. If you learn what it is the wizard does, then you don't have to depend on it.
-
Sometimes the wizards get out of whack is some of the commented text that is in the header/source files is removed. Why not add the control by hand? It's really not that difficult. This is the problem with people using wizards... when they fail, you're left with no recourse. If you learn what it is the wizard does, then you don't have to depend on it.
Unfortunately adding it by hand also didn't work at all. See the problem: It crashes now inside DDX_Control(pDX, IDC_EDIT_Address, MacAddressEditCtrl ); where IDC_EDIT_Address is the id and MAcAddressEditctrl is CWnd object. oid AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl) { if ((rControl.m_hWnd == NULL) && (rControl.GetControlUnknown() == NULL)) // not subclassed yet { ASSERT(!pDX->m_bSaveAndValidate); pDX->PrepareCtrl(nIDC); ////it crashes here...and inside it int the long run inside of code somehere..it calls GetOleControlSite() and there it is observed that m_pCtrlCont is NULL. HWND hWndCtrl; pDX->m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); if ((hWndCtrl != NULL) && !rControl.SubclassWindow(hWndCtrl)) { ASSERT(FALSE); // possibly trying to subclass twice? AfxThrowNotSupportedException(); } ifndef _AFX_NO_OCC_SUPPORT else { if (hWndCtrl == NULL) { if (pDX->m_pDlgWnd->GetOleControlSite(nIDC) != NULL) { rControl.AttachControlSite(pDX->m_pDlgWnd, nIDC); } } else { // If the control has reparented itself (e.g., invisible control), // make sure that the CWnd gets properly wired to its control site. if (pDX->m_pDlgWnd->m_hWnd != ::GetParent(rControl.m_hWnd)) rControl.AttachControlSite(pDX->m_pDlgWnd); } } endif //!_AFX_NO_OCC_SUPPORT } }
-
Unfortunately adding it by hand also didn't work at all. See the problem: It crashes now inside DDX_Control(pDX, IDC_EDIT_Address, MacAddressEditCtrl ); where IDC_EDIT_Address is the id and MAcAddressEditctrl is CWnd object. oid AFXAPI DDX_Control(CDataExchange* pDX, int nIDC, CWnd& rControl) { if ((rControl.m_hWnd == NULL) && (rControl.GetControlUnknown() == NULL)) // not subclassed yet { ASSERT(!pDX->m_bSaveAndValidate); pDX->PrepareCtrl(nIDC); ////it crashes here...and inside it int the long run inside of code somehere..it calls GetOleControlSite() and there it is observed that m_pCtrlCont is NULL. HWND hWndCtrl; pDX->m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); if ((hWndCtrl != NULL) && !rControl.SubclassWindow(hWndCtrl)) { ASSERT(FALSE); // possibly trying to subclass twice? AfxThrowNotSupportedException(); } ifndef _AFX_NO_OCC_SUPPORT else { if (hWndCtrl == NULL) { if (pDX->m_pDlgWnd->GetOleControlSite(nIDC) != NULL) { rControl.AttachControlSite(pDX->m_pDlgWnd, nIDC); } } else { // If the control has reparented itself (e.g., invisible control), // make sure that the CWnd gets properly wired to its control site. if (pDX->m_pDlgWnd->m_hWnd != ::GetParent(rControl.m_hWnd)) rControl.AttachControlSite(pDX->m_pDlgWnd); } } endif //!_AFX_NO_OCC_SUPPORT } }
Where's the code where you describe MacAddressEditCtrl? Are you positive IDC_EDIT_Address exists in the resources? When you try to access this variable, are you sure there's an instance of the dialog created? Has OnInitDialog() been called already? If I had to guess, you're probably trying to use the control before it has been created.
-
Where's the code where you describe MacAddressEditCtrl? Are you positive IDC_EDIT_Address exists in the resources? When you try to access this variable, are you sure there's an instance of the dialog created? Has OnInitDialog() been called already? If I had to guess, you're probably trying to use the control before it has been created.
Thanks Albert. As you pointed out and I realized that I placed and written the code of another OnInitDialog.. It was main dialog's control of whole I was trying to manipulate of another dialog's code. Thanks
-
Hi, I am having a problem. I have a project "MicroSIP" which is used for SIP based call voice over IP. I am running it into VS 2010 and I need to customize it according to my need. For this as soon as I edit the main dialog ( Dialer ) and add some other controls ( like edit control of CEdit) and add member variable for from wizard of "Add Variable", it shows the message "unable to update DoDataExchange method". More over if getting reference of newly placed "Edit Control" in the program , it has NULL pointer or undefined reference. Anybody having any idea about this to resolve or some way around to resolve the issue. I am having extremely trouble for solving this scanario. Regards Usman Khalil