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. Checking of a file before the main window is shown

Checking of a file before the main window is shown

Scheduled Pinned Locked Moved C / C++ / MFC
algorithmshelptutorial
2 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.
  • Y Offline
    Y Offline
    ykutanoor
    wrote on last edited by
    #1

    Sir, I am doing a file searching program before my appication shows its screen. If the file exists then the main window is shown otherwise an error is reported to the client. I know the code to be written will be in InitInstance but do not understand the exact place to write. Say..... if File Exists Show the Main window else Do not show the main window Report an error to the client. Regards Ykut Pls guide

    N 1 Reply Last reply
    0
    • Y ykutanoor

      Sir, I am doing a file searching program before my appication shows its screen. If the file exists then the main window is shown otherwise an error is reported to the client. I know the code to be written will be in InitInstance but do not understand the exact place to write. Say..... if File Exists Show the Main window else Do not show the main window Report an error to the client. Regards Ykut Pls guide

      N Offline
      N Offline
      n 0
      wrote on last edited by
      #2

      well, this seems to be pretty simple to me if i got that right: BOOL FindFile(void) { BOOL bResult; // ... return bResult; // return TRUE if your file's been found } // initinstance() if( FindFile() ) { CYourDialog dlg; if( dlg.DoModal() == IDOK ) // client clicked OK else // client clicked cancel } else { MessageBox(NULL, // your error msg... } ////////////////////////////////////////// i made a dialog-based app, for the sake of simplicity and clarity... hope this helps Я люблю русский языкь!

      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