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. SHGetPathFromID under WinXP vs Win2000

SHGetPathFromID under WinXP vs Win2000

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionvisual-studiodesigndebugging
1 Posts 1 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.
  • M Offline
    M Offline
    Mark Terrano
    wrote on last edited by
    #1

    Problem: Code working for a long time under WinME/2000/98 does not work under WinXP. Little function to pop up a dialog box and allow the user to pick a folder (or file) which is returned as a CString. I get back the wrong value if user creates new folder or types non-existing folder into box. What I'm looking for: Function to pop up dialog and get back existing or new folder as specified by user. Symptoms: Works just as I would expect it to under Win98/ME/2000. Under WinXP if the user creates a folder, or types a new folder into the edit box I get back a reference to their user directory. (Please excuse a bit of 'debugging mess' I'm still trying to figure out what is going on). Also, there are some header files that I don't have the latest versions of, being limited to VC6 with all patches (so you can ignore my comments about BIF_USENEWUI - which is documented but appears at some later point I think). I didn't see any KB articles related to WinXP for either of my two functions-in-question. Any help would be appreciated! --Mark -----My Test Code------ CString CXpgetfoldercheckDlg::getFolderName(CString title, bool requireTrailingBackslash, bool allowNewFolders) { // PURPOSE: // Uses latest UI to get a folder name. // PARAMS: // title = the title of the browse dialog. // rquireTrailingBackslash = true if you want the last character of the folder to be '\' (default t) // allowNewFolders = true if you want a 'new' button to appear on the dialog (default t) // RETURNS: // valid folder name if successful or NULL if not // REQUIRED: // IE 5.0 on up, or Win2000 on up // STEPS: // Bring up a common file dialog, // Allow the user's to select a folder name // Close the dialog // // KNOWN BUG: Problem with WindowXP (11-2-2001) - typed-in filename (i.e. new file name) returns the // user's mydocuments folder. // Results with the following settings // info.ulFlags = BIF_RETURNONLYFSDIRS | BIF_EDITBOX; BROWSEINFO info; ITEMIDLIST *list; HRESULT ret; DWORD dwCoInit=COINIT_APARTMENTTHREADED; ret = CoInitializeEx(NULL,dwCoInit); if (ret == S_OK || ret == S_FALSE ) TRACE("CoInitted\n"); else { return "ERR: Failed CoInit"; } //info.ulFlags = BIF_RETURNONLYFSDIRS | BIF_USENEWUI ; //new // Where are these? // BIF_USENEWUI // BIF_NEWDIALOGSTYLE //FIXME: Could not get the various header issues to work, so I just added the param values

    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