473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

IshellFolder and

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.


Jan 4 '06 #1
1 2120
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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jan 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Melinda | last post by:
hi all, i'm having problems with BindToObject(). when i call the method it is throwing a System.NullReferenceException error, but i don't understand why. what i'm trying to do is get a...
0
by: Robin Tucker | last post by:
I need to create my own explorer-style control - I don't seem to have access to IShellFolder - assuming I need it (which I think I do), how can this be done? I've imported shell32.dll into my...
4
by: Robin Tucker | last post by:
I can't get this damned IEnumIDList thing to work correctly. I've got the desktop folder as an IShellObject (which I've verified by being able to get the display name etc. from it). I can also...
2
by: Robin Tucker | last post by:
I've got this nice pidl, enumerated via. IEnumIDList on an IShellFolder (the desktop). I know the pidl is ok, because I can list its display name and its looking good. Now I want to go a level...
2
by: Nicola Garone | last post by:
Hi all I'm using VB.net. I need to define an object of type iShellFolder (since I have to call ShGetDesktopfolder API in Shell32.dll). I've created interop.Shell32.dll adding a reference to...
4
by: Nicola Garone | last post by:
Hi all, I need to enumerate pidl in a directory which I got (I think) the rigt pidl, but I don't know how to procede. here is a piece of code (folder is a IShellFolder object and it seems to...
1
by: Nicola Garone | last post by:
Hi all, here I am again :-( , this turn I'm in trouble with IShellFolder.GetUIObjectsOf, which raise an exception while accessing an uninstantiated object (I have Italian version softwares and I...
2
by: Andrius B. | last post by:
Hi all. Does anyone can suggest a good webpage or site, where I could read about how to use IShellFolder interface in vb .net ? E.g., I have added reference to IShellFolderEx_TLB.dll, but what...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.