Re: Add a CDialog variable to a class



ja wrote:

Hi, all
I want to add a member variable of CAboutDlg type to a existing class's head file, but the complier always tell me the following information like:
my code : CAboutDlg * myDlg; //def in a class head file
the error: error C2143: lack of ";" (before * ) //

it seems the complier does not know what is CmyAppDlg?

Could anybody tell me why?

Thanks in advance!

-ja



ja:

Just forward declare CAboutDlg:

// MyClass.h

class CAboutDlg; // forward declaration

class MyClass
{
private:
CAboutDlg* myDlg;
};

David Wilkinson

.