Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Dialog docking pane and UpdateData
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dialog docking pane and UpdateData

 Post Reply Post Reply
Author
Message
mehlah View Drop Down
Newbie
Newbie
Avatar

Joined: 22 December 2008
Location: France
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mehlah Quote  Post ReplyReply Direct Link To This Post Topic: Dialog docking pane and UpdateData
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mehlah View Drop Down
Newbie
Newbie
Avatar

Joined: 22 December 2008
Location: France
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mehlah Quote  Post ReplyReply Direct Link To This Post Posted: 29 December 2008 at 8:58am
Many thanks !!
It works

I don't care about the double instanciation
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.