Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. This works, but is it the right way to do it

This works, but is it the right way to do it

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kjessee
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • K kjessee

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      K 1 Reply Last reply
      0
      • C Christian Graus

        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

        K Offline
        K Offline
        kjessee
        wrote on last edited by
        #3

        I took out some code to make it easier to read.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups