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!

Create a new document

Status
Not open for further replies.

StefanoCarniel

Programmer
Apr 29, 2005
15
IT
I developed a simple program with a classic File menu (New, Open, ...).
When I select the New options, I show a Dialog to set some parameters for the new document and when I click on the Ok button I want the program create the new document. The problem is if I open an existing document and then select New document, the program does not close the previous document because in the title bar of the program I still see the name of the opened document. This is because the program does not call the OnNewDocument function of the class CTestDoc.
Here's some code, I hope someone can help me.

void CMainFrame::OnFileNew()
{
CNewFrame frm;
frm.DoModal();

}

CNewFrame is the dialog box I created for insert the parameters.

void CNewFrame::OnOK()
{
BkColor = RGB (0, 0, 0);
CDialog::OnOK();
}

I think I should call the OnNewDocument inside this function but I don't know how.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top