IContextMenu with multiple items
Posted on 1998-11-09
Can anybody give me a Delphi 3 or Delphi 4 sample which uses IShellFolder.GetUIObjectOf to get the context menu for MULTIPLE OBJECTS. I can get it working fine for ONE object, but when I try to get multiple objects I get a GPF.
The online help says that the 3rd parameter for GetUIObjectOf (apidl) is a "pointer to an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Each item identifier list must contain exactly one SHITEMID structure followed by a terminating zero."
I've tried several things, but using a "pointer to an array of pointers" seems to cause the most problems! As I said, I can get it to work fine for a single object relative to the IShellFolder, but if I try to get the combined context menu for 2/more items, I get Access Violations, etc.
Any help much appreciated!
P.S. My functions for manipulating PIDLs could be half the problem, although I do other things with PIDLs & IShellFolders which *seem* to work fine.