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)


Dim sb As New StringBuilder(MAX_PATH)



PidlFound = SHGetSpecialFolderLocation(0, k, lngPidl)

If PidlFound = 0 Then


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

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********
I tried the "A" version and Auto

They all crash

This sample code uses it without problems:

Also, try checking out

Patrick Steele
Microsoft .NET MVP
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.