Click here to Skip to main content
16,007,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow Long Will It Take Pin
---Mark---25-May-04 19:04
---Mark---25-May-04 19:04 
AnswerRe: How Long Will It Take Pin
Curi0us_George25-May-04 19:20
Curi0us_George25-May-04 19:20 
AnswerRe: How Long Will It Take Pin
Bob Stanneveld25-May-04 21:01
Bob Stanneveld25-May-04 21:01 
AnswerRe: How Long Will It Take Pin
David Crow26-May-04 3:21
David Crow26-May-04 3:21 
GeneralRe: How Long Will It Take Pin
Antony M Kancidrowski26-May-04 4:01
Antony M Kancidrowski26-May-04 4:01 
GeneralFile Description Pin
ptilokch25-May-04 18:53
ptilokch25-May-04 18:53 
GeneralRe: File Description Pin
Michael Dunn25-May-04 19:16
sitebuilderMichael Dunn25-May-04 19:16 
GeneralTrying to get Target Folder from Folder Shortcut Pin
Mike203625-May-04 18:46
Mike203625-May-04 18:46 
I'm trying to get the Target Folder path from a Folder Shortcut PIDL and I can't seem to find where this is or how to get it. From everything I've read it looked like a "simple" matter of binding an LPSHELLFOLDER variable to the PIDL, performing a QueryInterface (using IID_IPersistFolder3) and then calling its GetFolderTargetInfo method to get the goods. But it doesn't work. It looks like I can get the pointer to the Folder Shortcut's Shell Object, and it seems like the QueryInterface call succeeds to get a pointer to the IPersistFolder3 interface, but when I perform the GetFolder, the path values are empty and the PIDL doesn't look to be the same PIDL (in terms of its values not the address) I used on the BindToObject. I've been going round and round with this. Windows Explorer is privy to this information (shows up in the 'Target:' section of the Properties pop-up) so there's gotta be a way to get it. I need it to build a complete UNC or mapped drive path in my mini-browser for my app.

I've also tried seemingly obvious APIs like SHGetPathFromIDList() but this produces a path to the shortcut in the Documents folder, not the actual Target Folder. Any help would be greatly appreciated. Thanks in advance!

-Mike

P.S. Code snippet:

IPersistFolder3 * pPersistFolder = NULL;
IShellFolder * pSubFolder = NULL;

// pEnum->pshfParent references the 'My Network Places' PIDL in
// this scenario
hr = pEnum->pshfParent->BindToObject(
pItemIdList, // [in] folder shortcut PIDL
NULL,
IID_IShellFolder,
(VOID**) &pSubFolder);

// hr == S_OK && pSubFolder

hr = pSubFolder->QueryInterface(
IID_IPersistFolder3,
(VOID **) &pPersistFolder);

// hr == S_OK && pPersistFolder

PERSIST_FOLDER_TARGET_INFO targetInfo;
memset(&targetInfo, 0x00, sizeof(PERSIST_FOLDER_TARGET_INFO));

hr = pPersistFolder->GetFolderTargetInfo(
&targetInfo);

// Doesn't give the Target Location!


GeneralRe: Trying to get Target Folder from Folder Shortcut Pin
Mike203626-May-04 10:03
Mike203626-May-04 10:03 
QuestionIs It Possible to do this? Pin
Shuang. Wu25-May-04 18:44
Shuang. Wu25-May-04 18:44 
AnswerRe: Is It Possible to do this? Pin
Abin25-May-04 19:26
Abin25-May-04 19:26 
GeneralRe: Is It Possible to do this? Pin
Shuang. Wu25-May-04 21:56
Shuang. Wu25-May-04 21:56 
AnswerRe: Is It Possible to do this? Pin
Iain Clarke, Warrior Programmer26-May-04 1:19
Iain Clarke, Warrior Programmer26-May-04 1:19 
GeneralMFC Rich Edit Contrl and ASCII file Pin
addo21425-May-04 18:19
addo21425-May-04 18:19 
GeneralRe: MFC Rich Edit Contrl and ASCII file Pin
David Crow26-May-04 4:52
David Crow26-May-04 4:52 
GeneralMFC OnClose() behaviour Pin
J.B.25-May-04 17:03
J.B.25-May-04 17:03 
GeneralRe: MFC OnClose() behaviour Pin
Bob Stanneveld25-May-04 21:09
Bob Stanneveld25-May-04 21:09 
GeneralRe: MFC OnClose() behaviour Pin
Diddy26-May-04 0:13
Diddy26-May-04 0:13 
GeneralRe: MFC OnClose() behaviour Pin
David Crow26-May-04 3:30
David Crow26-May-04 3:30 
GeneralRe: MFC OnClose() behaviour Pin
J.B.27-May-04 0:46
J.B.27-May-04 0:46 
GeneralVC.Net In VC6 Pin
Anonymous25-May-04 13:56
Anonymous25-May-04 13:56 
GeneralRe: VC.Net In VC6 Pin
Anonymous25-May-04 15:54
Anonymous25-May-04 15:54 
GeneralRe: VC.Net In VC6 Pin
Ryan Binns25-May-04 18:14
Ryan Binns25-May-04 18:14 
GeneralRe: VC.Net In VC6 Pin
Anonymous25-May-04 18:40
Anonymous25-May-04 18:40 
GeneralRe: VC.Net In VC6 Pin
Ryan Binns25-May-04 18:43
Ryan Binns25-May-04 18:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.