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. File Save As from ATL (no MFC)

File Save As from ATL (no MFC)

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
3 Posts 3 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.
  • C Offline
    C Offline
    Chris L 0
    wrote on last edited by
    #1

    can somebody point me in the right direction? i've been assigned to do an non-MFC ATL control that requires the use of the common Save As... dialog. i know it's easy to do with MFC, but like i said.. this is a non-MFC app. any hints would be appreciated. -c

    M U 2 Replies Last reply
    0
    • C Chris L 0

      can somebody point me in the right direction? i've been assigned to do an non-MFC ATL control that requires the use of the common Save As... dialog. i know it's easy to do with MFC, but like i said.. this is a non-MFC app. any hints would be appreciated. -c

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Use the GetSaveFileName() API.

      1 Reply Last reply
      0
      • C Chris L 0

        can somebody point me in the right direction? i've been assigned to do an non-MFC ATL control that requires the use of the common Save As... dialog. i know it's easy to do with MFC, but like i said.. this is a non-MFC app. any hints would be appreciated. -c

        U Offline
        U Offline
        User 1052
        wrote on last edited by
        #3

        Here is a snippet of code where I am doing this OPENFILENAME OpenFileName; TCHAR szFile[MAX_PATH] = "\0"; strcpy( szFile, ""); // Fill in the OPENFILENAME structure to support a template // and hook. OpenFileName.lStructSize = sizeof(OPENFILENAME); OpenFileName.hwndOwner = NULL; OpenFileName.hInstance = NULL; OpenFileName.lpstrFilter = "Data Files\0*.DAT\0"; OpenFileName.lpstrCustomFilter = NULL; OpenFileName.nMaxCustFilter = 0; OpenFileName.nFilterIndex = 0; OpenFileName.lpstrFile = szFile; OpenFileName.nMaxFile = sizeof(szFile); OpenFileName.lpstrFileTitle = NULL; OpenFileName.nMaxFileTitle = 0; OpenFileName.lpstrInitialDir = "C:\\YourPath"; OpenFileName.lpstrTitle = "Select A File"; OpenFileName.nFileOffset = 0; OpenFileName.nFileExtension = 0; OpenFileName.lpstrDefExt = NULL; OpenFileName.lCustData = NULL; OpenFileName.lpfnHook = NULL; OpenFileName.lpTemplateName = NULL; OpenFileName.Flags = OFN_EXPLORER ; // Call the common dialog function. if (GetOpenFileName(&OpenFileName)) { strcpy(chFileName,(LPCTSTR)OpenFileName.lpstrFile); }

        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