![]() |
Dialog docking pane and UpdateData |
Post Reply ![]() |
Author | |
mehlah ![]() Newbie ![]() ![]() Joined: 22 December 2008 Location: France Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() Posted: 27 December 2008 at 1:00am |
Hi,
I deal with a problem for some weeks now and i don't know what's wrong with my code... PROBLEM: Debug assertion failed when a try to UpdateData for a dialog attached to a pane... I attached to my post my MainFrame.cpp, myprojectDoc.cpp and mydialog.cpp (also .h files) for more details and some indentation ![]() First i create my dialog and attach it to a pane in MainFrame.cpp (exactly like sample projetcs) LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam) { . . . case IDR_PANE_INFO: if (!::IsWindow(m_dlgInfoPane.m_hWnd)) { m_dlgInfoPane.Create(IDD_INFOPANE, this); } pPane->Attach(&m_dlgInfoPane); break; . . . In CDlgInfoPane.cpp (Definition of my dialog class) I have this method: BOOL CDlgInfoPane::transferInfo(CString imageFilePath, int imageWidth, int imageHeight, int imageFileSize, int imageBPP, CString imageColorType) { m_imageFilePath = imageFilePath; m_imageWidth = imageWidth; m_imageHeight = imageHeight; m_imageFileSize = imageFileSize; m_imageBPP = imageBPP; m_imageColorType = imageColorType; UpdateData(FALSE); // Debug assertion failed here !! //GetDlgItem(IDC_FILEPATH)->SetWindowText(imageFilePath); //::SendDlgItemMessage((HWND)*this,IDD_INFOPANE,WM_SETTEXT,0,(LPARAM)_T("toto")); return TRUE; } it takes some variables from myprojectDoc.cpp and copy them to my private fialog variables... In debug mode, m_imageFilePath, m_imageWidth,... m_imageColorType have the good values But in the UpdateData line (or GetDlgItem...) there is a f**king problem: Take a look to screenshots... I want to update data for the "Information" pane... ![]() Have you please an idea for what is wrong ?? Thanks and sorry for my bad english ![]() |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, You create 2 instances of CDlgInfoPane. One in CMainFrame and another in CmyWatermarkDoc. So when you call one in CmyWatermarkDoc - it call UpdateData of dialog that don't have hWnd.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
mehlah ![]() Newbie ![]() ![]() Joined: 22 December 2008 Location: France Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
Many thanks !!
It works ![]() I don't care about the double instanciation ![]() |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |