ShellLib.ShellFunctions.GetDesktopFolder
(1)
PShellFolder.GetUIObjectOf
(1)
ShellLib.IShellFolder
(1)
PShellFolder.ParseDisplayName
(1)
GetUIObjectOf
(1)
IShellFolder
(1)
PShellFolder
(1)
SPath.Length
(1)

How to program IShellFolder::GetUIObjectOf

Asked By Anjali A
30-Dec-09 02:20 AM
I am getting System>AccessViolationException while debugging the below code. Can anyone please help me...



ShellLib.IShellFolder pShellFolder;

pShellFolder = ShellLib.ShellFunctions.GetDesktopFolder();



string sPath = "C:\\Documents and settings\\giji\\Desktop\\gg.doc";

uint var = (uint)sPath.Length;

IntPtr pidlchild;

uint pdw=0;

pShellFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, sPath, ref var, out pidlchild,ref pdw);





Guid riid = new Guid("BB2E617C-0920-11d1-9A0B-00C04FC2D6C1");

IntPtr ppv;

uint len = 1;

uint reser = 0;

IntPtr[] arry = { pidlchild };

pShellFolder.GetUIObjectOf(IntPtr.Zero, len,arry, riid, ref reser, out ppv);
Post Question To EggHeadCafe