Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dialog pop ups....'CHistory' : undeclared identifier

Status
Not open for further replies.

jw970170

Programmer
Aug 8, 2005
38
I created another dialog which I want to pop up when I hit the a certain menu button. It does not work however. The help one does pop up though and the code seems almost identical.

this is the code which makes the help dialog pop up. The second dialog I made is called History and has it's own call called CHistory.
void CCalcDlg::Onabout()
{
// TODO: Add your command handler code here
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}

This code did not work for the History dialog.
void CCalcDlg::Onhistory()
{
// TODO: Add your command handler code here
CHistory histDlg;
histDlg.DoModal();
}

this is my error: 'CHistory' : undeclared identifier
However, CHistory is a class that is listed under my class view.


For some reason, whenever I create the CHistory class, its constructor is CHistory::CHistory(CWnd* pParent /*=NULL*/) : CDialog(CHistory::IDD, pParent) while the about dialog constructor is CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) I don't know if this difference is causing my problem or not.
 
um...

You have to #include the header file for the CHistory class.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top