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. IFileSaveDialog / Filename

IFileSaveDialog / Filename

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
4 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.
  • J Offline
    J Offline
    jung kreidler
    wrote on last edited by
    #1

    Where can I update the edit field to reflect changes of the file name to save? I have customized my save file dialog and use CFileDlgEventHandler. There i need to set a different filename. In the file save dialog I select a filename from existing files, e.g. blah.tif. After clicking a custom checkbox I need to set e.g. blah_C1.tif. I can get and set the filename inside the handler: CComQIPtr pDlg = pfdc; pDlg->GetFileName(...) and pDlg->SetFileName(...) work, but after clicking 'Save' I get the filename previously selected (blah.tif) and not the changed one. Anyone out there with a tip to update the edit control behind the scenes?

    A 1 Reply Last reply
    0
    • J jung kreidler

      Where can I update the edit field to reflect changes of the file name to save? I have customized my save file dialog and use CFileDlgEventHandler. There i need to set a different filename. In the file save dialog I select a filename from existing files, e.g. blah.tif. After clicking a custom checkbox I need to set e.g. blah_C1.tif. I can get and set the filename inside the handler: CComQIPtr pDlg = pfdc; pDlg->GetFileName(...) and pDlg->SetFileName(...) work, but after clicking 'Save' I get the filename previously selected (blah.tif) and not the changed one. Anyone out there with a tip to update the edit control behind the scenes?

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      Have you tried overriding the CFileDialog class (MFC)? ...that should be easier to accomplish using MFC. In order to change the text, you just need to get the control ID (use Spy++ if you can't find documentation as to the ID) and set the new text using SetWindowText()[^].

      J 1 Reply Last reply
      0
      • A Albert Holguin

        Have you tried overriding the CFileDialog class (MFC)? ...that should be easier to accomplish using MFC. In order to change the text, you just need to get the control ID (use Spy++ if you can't find documentation as to the ID) and set the new text using SetWindowText()[^].

        J Offline
        J Offline
        jung kreidler
        wrote on last edited by
        #3

        I use the new Vista/W7 style COM dialogs, which use a different interface (not MFC). Hmm, obviously wrong forum (...as always...). I'll pass it to COM forum. The problem is that there must be another control above the edit control (checkbox), which holds the filename, too. The interface does not offer a function to set the filename of the checkbox. I can set the filename of the edit, but it is not passed through, when hitting OK. :(

        A 1 Reply Last reply
        0
        • J jung kreidler

          I use the new Vista/W7 style COM dialogs, which use a different interface (not MFC). Hmm, obviously wrong forum (...as always...). I'll pass it to COM forum. The problem is that there must be another control above the edit control (checkbox), which holds the filename, too. The interface does not offer a function to set the filename of the checkbox. I can set the filename of the edit, but it is not passed through, when hitting OK. :(

          A Offline
          A Offline
          Albert Holguin
          wrote on last edited by
          #4

          jung-kreidler wrote:

          Vista/W7 style COM dialogs

          You can still use MFC if you wanted to.... ...but anywho, yeah, I couldn't help you with COM.

          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