OVH Cloud OVH Cloud

Probleme Shell API

1 réponse
Avatar
Flzw
Je vais faire quelquechose, je ne sais pas si c'est mal vu, j'ai posé une
question sur
comp.os.ms-windows.programmer.win32 mais quelqu'un ici pourrait peut etre
m'aider
donc je recopie ma question (en anglais :/ désolé j'ai pas le courage de
traduire), vous
pouvez me repondre en francais, si c'est mal vu comme pratique dites le moi
et j'eviterais
a l'avenir, merci.

--

I have a TreeView Control that is filled with a "My Computer" item and all
the local disks as child of the MyComputer item.

This works fine with the icons and all ;)

ok, so now, when the user expands the MyComputer item, I want to add the
items corresponding to the each local drives 1st level subfolder
I want to do that because what I first did was filling the treeview with the
items for all the folders on all local disks, well, it works, but it was
really slow to load up the app.

So I catch TVN_ITEMEXPANDING, no problem, I can get a list of the child
items with TreeView_GetChild and TreeView_GetNextSibling macros and so I
have the text displayed for each item. So far it works just fine

So to list an item subfolders I need to get a pidl, since I filled the
TreeView items text with the DISPLAY NAME I got from a call to
SHGetFileInfo, I wanted to do that :
--
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, (LPCSTR) &ItemText, -1,
WDisplayName, 32);
MyComp->ParseDisplayName( NULL, NULL, (LPOLESTR) WDisplayName, NULL,
&pidl, NULL);
MyComp->BindToObject( pidl, NULL, IID_IShellFolder, (void**)
&ChildFolder);
--

Note that after the call to MultiByteToWideChar() WDisplayName is fine and
points to the good string
but ParseDisplayName fail and doesn't retrieve a PIDL.... and if I don't
catch it BindToObject just crashes the app.

I don't know why this doesn't work nor how I could do it an other way...
Thanks for the help

1 réponse

Avatar
Christian ASTOR
Flzw a écrit:

ok, so now, when the user expands the MyComputer item, I want to add the
items corresponding to the each local drives 1st level subfolder
I want to do that because what I first did was filling the treeview with the
items for all the folders on all local disks, well, it works, but it was
really slow to load up the app.



Pour changer, enumdesk.cpp...