SHGetPathFromIDList crashes

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

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
 
Back
Top