Similar to your previous question at
I get always an error "exception thrown: write access violation. Lpsh was nullptr."[
^]. But in this case you create a pointer but you do not initialise it to point to anything. If you do not understand pointers and references then go back to your C reference for guidance.
For an example of using the
IShellFolder
interface see
Getting Information About the Contents of a Folder - Win32 apps | Microsoft Learn[
^].
[edit]
Also the following is incorrect in the call to
ParseDisplayName
;
(LPWSTR)"C:"
You cannot use a cast to convert an
ASCII
string to
Unicode
. You need to generate the
Unicode
characters at compile time by using the
L
prefix to the string, thus:
L"C:"
[/edit]