Print Page | Close Window

Dialog docking pane and UpdateData

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=13020
Printed Date: 12 May 2025 at 8:58pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dialog docking pane and UpdateData
Posted By: mehlah
Subject: Dialog docking pane and UpdateData
Date 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 uploads/20081227_005934_src.zip - uploads/20081227_005934_src.zip



Replies:
Posted By: Oleg
Date Posted: 29 December 2008 at 3:28am

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


Posted By: mehlah
Date Posted: 29 December 2008 at 8:58am
Many thanks !!
It works

I don't care about the double instanciation



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net