-
DoModel error
Hi ,
the problem is i have new button in Update dialog window when i click
on new button i have to open create dialog window ..
so for that i declared CCreateDlg *m_dCreateDlg; member
can u plz help me solve this error
-----------
UpdateDlg.h
#include "StatusDlg.h" // Added by ClassView
#include "CreateDlg.h" // Added by ClassView
private:
CStatusDlg m_dStatusDlg;
class CCreateDlg;
//Then declare a pointer:
CCreateDlg *m_dCreateDlg;
---------------------------------------
// UpdateDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DesktopSearch.h"
#include "StatusDlg.h"
#include "CreateDlg.h"
#include "UpdateDlg.h"
#include "FoldersDialog.h"
void CUpdateDlg::OnNew()
{
// TODO: Add your control notification handler code here
m_dCreateDlg->DoModal();
}
---------------------------------------------------------------
--------------------Configuration: DesktopSearch - Win32
Debug--------------------
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\UpdateDlg.cpp(184) : error C2027: use of
undefined type 'CCreateDlg'
d:\parichay\desktopsearch\updatedlg.h(58) : see declaration of
'CCreateDlg'
D:\Parichay\DesktopSearch\UpdateDlg.cpp(184) : error C2227: left of
'->DoModal' must point to class/struct/union
Error executing cl.exe.
DesktopSearch.exe - 2 error(s), 0 warning(s)
-
Re: DoModel error
Your -pointer- "m_dCreateDlg" is pointing to empty space. You actually have
to create the object (a CDialog) that it points to -- using "new", or else
using an assignment such as dCreateDlg = &m_dStatusDlg; to an already
created object.
--
---------------------------------------------------------------------
DataGet® & PocketLog® [url]www.dataget.com[/url]
Data Collectors [url]www.baxcode.com[/url]
--------------------------------------------------------------------
"Pari" <parichay.bp@gmail.com> wrote in message
news:1144741817.759511.261090@t31g2000cwb.googlegroups.com...[color=blue]
> Hi ,
>
> the problem is i have new button in Update dialog window when i click
> on new button i have to open create dialog window ..
>
> so for that i declared CCreateDlg *m_dCreateDlg; member
>
> can u plz help me solve this error
> -----------
> UpdateDlg.h
>
> #include "StatusDlg.h" // Added by ClassView
> #include "CreateDlg.h" // Added by ClassView
>
> private:
> CStatusDlg m_dStatusDlg;
>
> class CCreateDlg;
> //Then declare a pointer:
> CCreateDlg *m_dCreateDlg;
> ---------------------------------------
>
> // UpdateDlg.cpp : implementation file
> //
>
> #include "stdafx.h"
> #include "DesktopSearch.h"
> #include "StatusDlg.h"
> #include "CreateDlg.h"
> #include "UpdateDlg.h"
> #include "FoldersDialog.h"
>
>
> void CUpdateDlg::OnNew()
> {
> // TODO: Add your control notification handler code here
>
> m_dCreateDlg->DoModal();
> }
>
>
> ---------------------------------------------------------------
> --------------------Configuration: DesktopSearch - Win32
> Debug--------------------
> Compiling...
> UpdateDlg.cpp
> D:\Parichay\DesktopSearch\UpdateDlg.cpp(184) : error C2027: use of
> undefined type 'CCreateDlg'
> d:\parichay\desktopsearch\updatedlg.h(58) : see declaration of
> 'CCreateDlg'
> D:\Parichay\DesktopSearch\UpdateDlg.cpp(184) : error C2227: left of
> '->DoModal' must point to class/struct/union
> Error executing cl.exe.
>
> DesktopSearch.exe - 2 error(s), 0 warning(s)
>[/color]