This works, but is it the right way to do it
-
from inside a dialog box in an MDI app
void CDlgbtnChart::OnOK() { UpdateData(); UpdateData ( FALSE ); m_SingleSpan; // This function does some stuff then writes file in sPathName Chart(m_DFile, m_LFile, m_PathName", m_SS, true, true ); // Is this the correct way to open the file into the editor? CMultiDocTemplate* pDoc; pDoc = new CMultiDocTemplate(IDR_PLUTOTYPE, RUNTIME_CLASS(CPlutoDoc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CPlutoView)); pDoc->OpenDocumentFile(m_sPathName); CDialog::OnOK(); }
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." Ben Franklin - 1759 -
from inside a dialog box in an MDI app
void CDlgbtnChart::OnOK() { UpdateData(); UpdateData ( FALSE ); m_SingleSpan; // This function does some stuff then writes file in sPathName Chart(m_DFile, m_LFile, m_PathName", m_SS, true, true ); // Is this the correct way to open the file into the editor? CMultiDocTemplate* pDoc; pDoc = new CMultiDocTemplate(IDR_PLUTOTYPE, RUNTIME_CLASS(CPlutoDoc), RUNTIME_CLASS(CChildFrame), RUNTIME_CLASS(CPlutoView)); pDoc->OpenDocumentFile(m_sPathName); CDialog::OnOK(); }
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." Ben Franklin - 1759kjessee wrote: UpdateData ( FALSE ); This does nothing - you did not change the variables, so why shove them back up into controls you're about to destroy ? kjessee wrote: m_SingleSpan; Is there some code inside <> missing here ? kjessee wrote: // Is this the correct way to open the file into the editor? It's the wrong spot - the dialog should not be responsible for opening a document, I'd be doing it when the dialog closes, if the return value is IDOK. I believe that the mainframe also has methods for opening a new file, which do all this for you, but I could be wrong. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
-
kjessee wrote: UpdateData ( FALSE ); This does nothing - you did not change the variables, so why shove them back up into controls you're about to destroy ? kjessee wrote: m_SingleSpan; Is there some code inside <> missing here ? kjessee wrote: // Is this the correct way to open the file into the editor? It's the wrong spot - the dialog should not be responsible for opening a document, I'd be doing it when the dialog closes, if the return value is IDOK. I believe that the mainframe also has methods for opening a new file, which do all this for you, but I could be wrong. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002