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 MULTISELECT

CFileDialog MULTISELECT

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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.
  • N Offline
    N Offline
    Nick Jacobs
    wrote on last edited by
    #1

    Hi Gang, I was wondering if anybody has a sample of a CFileDialog where I can select more than 12 items. It reliably selects 12, just nothing more. When more are highlighted, it just returns nothing. Any ideas? Env: VC6,sp5,XP/SP1 Thanks, Nick

    D N 2 Replies Last reply
    0
    • N Nick Jacobs

      Hi Gang, I was wondering if anybody has a sample of a CFileDialog where I can select more than 12 items. It reliably selects 12, just nothing more. When more are highlighted, it just returns nothing. Any ideas? Env: VC6,sp5,XP/SP1 Thanks, Nick

      D Offline
      D Offline
      dan g 0
      wrote on last edited by
      #2

      my memory of this is that for multi selection to work you must ensure that the buffer you pass in for the filenames is adequately sized. might this be the problem?

      1 Reply Last reply
      0
      • N Nick Jacobs

        Hi Gang, I was wondering if anybody has a sample of a CFileDialog where I can select more than 12 items. It reliably selects 12, just nothing more. When more are highlighted, it just returns nothing. Any ideas? Env: VC6,sp5,XP/SP1 Thanks, Nick

        N Offline
        N Offline
        Nish Nishant
        wrote on last edited by
        #3

        You need to allocate enough memory for the lpstrFileTitle member of the OPENFILENAME struct as well change the nMaxFile member! Nish


        Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

        N 1 Reply Last reply
        0
        • N Nish Nishant

          You need to allocate enough memory for the lpstrFileTitle member of the OPENFILENAME struct as well change the nMaxFile member! Nish


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

          N Offline
          N Offline
          Nick Jacobs
          wrote on last edited by
          #4

          Nishant S wrote: You need to allocate enough memory for the lpstrFileTitle member of the OPENFILENAME struct as well change the nMaxFile member! Nish Hey Nish, do you by chance have a quickie example? My program keeps excepting. I'm sure it's something simple. Thanks for the help, Nick

          A 1 Reply Last reply
          0
          • N Nick Jacobs

            Nishant S wrote: You need to allocate enough memory for the lpstrFileTitle member of the OPENFILENAME struct as well change the nMaxFile member! Nish Hey Nish, do you by chance have a quickie example? My program keeps excepting. I'm sure it's something simple. Thanks for the help, Nick

            A Offline
            A Offline
            Alwin75
            wrote on last edited by
            #5

            Hi Nick, the following code allows you to open multiple files in a MDI app. Tabbing got lost :) void CManagerApp::OnFileOpen() { // Query files to open CFileDialog dlg(true, _T("process"), NULL, OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY, _T("Process definitions (*.process)||")); DWORD dwMaxFile = 4096; dlg.m_ofn.nMaxFile = dwMaxFile; LPTSTR pszFilenames = new TCHAR[dwMaxFile]; dlg.m_ofn.lpstrFile = pszFilenames; dlg.m_ofn.lpstrFile[0] = NULL; if (dlg.DoModal() == IDOK) { // Open selected file(s) POSITION pos = dlg.GetStartPosition(); while(pos) OpenDocumentFile(dlg.GetNextPathName(pos)); } delete[] pszFilenames; } Alwin

            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