Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21337

How to pass a byte array to SHGetPathFromIDList

$
0
0
Hi folks,

I need to change a call to SHGetPathFromIDList so that I get folders with Unicode names – That is using a byte array instead of a string.

The old call using a string for the folder was..

PathID = SHBrowseForFolder(bInf)
Fldr = Space$(512)
RetVal = SHGetPathFromIDList(ByVal PathID, ByVal Fldr)
CoTaskMemFree PathID

And Never had a problem - ie there’s no problem with my declarations or SHbrowseforfolder call

My new call uses a byte array (FldrB) instead of string Fldr…..

PathID = SHBrowseForFolder(bInf)
ReDim FldrB(512)
RetVal = SHGetPathFromIDList(ByVal PathID, ByVal FldrB(0))
CoTaskMemFree PathID

The FldrB array does not receive the path.
I’ve tried several variations like By Ref FldrB(0) and varptr (FldrB(0)) but I still do not get the path in the byte array

What’s the correct way to do this?

Thanks in advance.

Viewing all articles
Browse latest Browse all 21337

Trending Articles