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.
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.