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. CFileDialog in CPropertyPage

CFileDialog in CPropertyPage

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionlearning
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.
  • W Offline
    W Offline
    Wim Jans
    wrote on last edited by
    #1

    Hello, I'm making a wizard and on one of the pages the user should select a filename. I could integrate a button which says 'select filename', make a CFileDialog variable and call DoModal and copy the selected name back into a field, but what I really want to do is display the CFileDialog as the content of my CPropertyPage instead of in a seperate window, of course without the Ok and Cancel buttons. I searched for any pointers in Google and msdn but couldn't find anything that helps me going in the right direction. Does anyone of you have any pointers or links to an example? Wim

    M 1 Reply Last reply
    0
    • W Wim Jans

      Hello, I'm making a wizard and on one of the pages the user should select a filename. I could integrate a button which says 'select filename', make a CFileDialog variable and call DoModal and copy the selected name back into a field, but what I really want to do is display the CFileDialog as the content of my CPropertyPage instead of in a seperate window, of course without the Ok and Cancel buttons. I searched for any pointers in Google and msdn but couldn't find anything that helps me going in the right direction. Does anyone of you have any pointers or links to an example? Wim

      M Offline
      M Offline
      Mike Upton
      wrote on last edited by
      #2

      I'm afraid that the answer is that you can't do it. You can't contain any of the common dialogs in a property page, because they're implemented as modal dialogs, not modeless child dialogs. The 'select filename' button that launches a separate CFileDialog is your only option. (This question is answered in the "Visual C++/MFC Frequently Asked Questions" article by Stingray Software in the MSDN Library, title "How do I embed a common dialog in a property page?")


      "We are the knights who say Ni" (The Knights Who Say Ni)

      J 1 Reply Last reply
      0
      • M Mike Upton

        I'm afraid that the answer is that you can't do it. You can't contain any of the common dialogs in a property page, because they're implemented as modal dialogs, not modeless child dialogs. The 'select filename' button that launches a separate CFileDialog is your only option. (This question is answered in the "Visual C++/MFC Frequently Asked Questions" article by Stingray Software in the MSDN Library, title "How do I embed a common dialog in a property page?")


        "We are the knights who say Ni" (The Knights Who Say Ni)

        J Offline
        J Offline
        Joan M
        wrote on last edited by
        #3

        But.. you can embed a common dialog inside another dialog and then call it... And if you can do so, you'll be able to use the newly created dialog as a property page (This is only a suposition)... Here's how to do it: (following the sample in the book) and referring to embed the common dialog inside a normal dialog... - Create a new dialog. - insert a group control where you'll want to get the common dialog inserted. - change it's ID to: stc32(=0x045f) if you cannot do it, contact me, I'll email you a sample (not in a property page but inside a dialog), the conversion should be easy... Remember... I'm not sure if this work inside a property page, but it seems that it should do it... 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