2012-04-30 24 views
0

我正在實現Windows-Explorer-view-like。SHBindToParent,得到一個父pidl

首先,我通過SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &pidl)獲取桌面pidl並將其存儲在類屬性中。在我的IShellBrowser::BrowseObject被調用後,我通過這個方法傳遞了pidl的屬性。如果我想上去,我打電話給SHBindToParent,將存儲的pidl傳遞給它,但是我得到了E_INVALIDARG或桌面pidl。我懷疑我在其中傳錯了PIDL。

我應該如何獲得家長PIDL的權利?

+0

請粘貼您的代碼片段。 – Xearinox

+0

恩,'IShellBrowser :: BrowseObject'採用相對pidl,但'SHBindToParent'採用絕對pidl。 –

回答

1
// C# 
[System.Runtime.InteropServices.DllImportAttribute("shell32.dll", EntryPoint="ILRemoveLastID")] 
    [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] 
public static extern bool ILRemoveLastID(System.IntPtr pidl) ; 

}