views:

193

answers:

1

In the following code example... where filePath is: "E:\[D]\My Collection" (a folder generated by picasa when it archives media) works okay on XP (32-bit). I recent ran this on vista 64-bit... and ParseDisplayName errors with "Value does not fall within the expected range." All other folders (without the '[D]') work okay. Any help would be appreciated.

try
{
   int cParsed = 0;
   int pdwAttrib = 0;
   string filePath = Path.GetDirectoryName(file);
   pidlMain = IntPtr.Zero;
   folder.ParseDisplayName(IntPtr.Zero,IntPtr.Zero,filePath,out cParsed,out pidlMain,out pdwAttrib);
}
catch (Exception ex)
{
Marshal.ReleaseComObject(folder);
throw ex;
}
A: 

This happens (irrespective of the code pack; you can repro it by using the shell API directly and getting the parsing name) on Vista when you select the folders in the Common File Dialog (or any type of Open dialog) from the left side tree view.

For e.g - using the example you mention - Code pack's sample. Run the sample, select browse, from the CFD, select your folder from the left side tree view. You will also get the same problem if you go inside the folder and then click on "Open". The parsing name that you get is:

"c:\folder\folder" (notice the duplicate folder).

This is a known issue in Vista... I am afraid there is no patch for it (or atleast that I am aware of - unless you switch to Win7 :-) )

Keeron
Keeron--thank you for this. I see what you mean. I need to find more time to review the rest of API Code Pack. I still to find the answer to my original question. Thank you again.
clsturgeon