By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

SHGetPathFromIDList crashes

P: n/a
I tried the "A" version and Auto

They all crash



Public Declare Function SHGetPathFromIDList Lib "shell32" Alias
"SHGetPathFromIDListW" (ByVal Pidl As Integer, _

<MarshalAs(UnmanagedType.LPStr, SizeConst:=MAX_PATH)> ByRef pszPath As
StringBuilder) As Integer

Anyone have a suggestion as to what else I could try??

Private Function GetSpecialPath(ByVal k As ShellSpecialFolderConstants)

...snip

Dim sb As New StringBuilder(MAX_PATH)

sb.Append(Space(MAX_PATH))

Try

PidlFound = SHGetSpecialFolderLocation(0, k, lngPidl)

If PidlFound = 0 Then

Try

FolderFound = SHGetPathFromIDList(lngPidl, sb) CRASHES HERE WITH UNHANDLED
EXCEPTION

Catch ex As Exception
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article <O$*************@TK2MSFTNGP12.phx.gbl>, ne********@a-znet.com
says...
I tried the "A" version and Auto

They all crash


This sample code uses it without problems:

http://weblogs.asp.net/psteele/articles/7536.aspx

Also, try checking out http://www.pinvoke.net

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.