IshellFolder and

A

Andrius B.

Hi. My problem concerns vb .net 2005.
I want to use IShellFolder interface for such functions as
ParseDisplayname. But how to parse a string - folder name (I mean, adding
terminating nullchar or smth.) to parsedisplay method? For exzample, if I
want to get PIDL for drive C: , should I use smth. like "C:\" &
vbNullChar ??? This code below gets no PIDL (t.i, zero).


Private Declare Function SHGetDesktopFolder Lib "shell32.dll" _
(ByRef ppshf As IShellFolderEx_TLB.IShellFolder) As Long
Dim pidl As IntPtr
Dim ss As IShellFolderEx_TLB.IShellFolder
ss = Nothing
SHGetDesktopFolder(ss)
Dim ass As String
ass = "C:\" & vbNullChar
ss.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, ass, IntPtr.Zero,
pidl, IntPtr.Zero)


Thanks in advance.
 
M

Mattias Sjögren

should I use smth. like "C:\" & vbNullChar ???

No you don't need to explicitly add the null terminator.

Private Declare Function SHGetDesktopFolder Lib "shell32.dll" _
(ByRef ppshf As IShellFolderEx_TLB.IShellFolder) As Long

The return type here should be Integer.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top