views:

39

answers:

0

In the following code, I am trying to get a folder location from the user. However, when I selected E:\ in the folder browser, szAbsolutePath doesn't give me the path for the CD burner temporary folder. This prevents me from saving to this location. However, if I choose something like E:\folder1\, I get the full path and can write out files to this location.

char szDisplayName[MAX_PATH];
BROWSEINFO binfo;
memset(&binfo, 0, sizeof(BROWSEINFO));
binfo.lpszTitle = strTitle.c_str();
binfo.hwndOwner = hwndOwner;
binfo.pszDisplayName = szDisplayName;
binfo.ulFlags = BIF_USENEWUI | BIF_NEWDIALOGSTYLE | BIF_BROWSEFILEJUNCTIONS | BIF_RETURNONLYFSDIRS;
PIDLIST_ABSOLUTE pidl = SHBrowseForFolder(&binfo);
if(pidl) {
  char szAbsolutePath[MAX_PATH];
  SHGetPathFromIDList(pidl, szAbsolutePath);
}

How can I always get the full path when the user chooses the root of the CD-R drive?