Get Parsing Char Array from PWSTR

Hey there,
I'm using Common Item Dialog to get a Folder Parsing.

I've extracted the Parsing Name using IShellItem::GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, PWSTR);

But how do I use that PWSTR to put the Display Name in a edit control for example?
Last edited on
This is a pretty basic question, so I guess you area beginner. However, beginners usually don't mess with COM interfaces. Maybe GetOPenFileName and GetSaveFileName are better choices for you.

As for the question, like this:
SetWindowTextW (hEdit, wstr);

Alternatively, use WM_SETTEXT and SendMessageW to do the same thing.
Thanks that was really helpful.

I realised that I have to shorten the pathway so that it will fit in the edit control simply for display.
i.e.
Shorten it to the next folder name that fits.

So my next question is..
How do I get the substring of a PWSTR?

Is there a wchar function similar to std::string::substr()?
Where I can input an index and integer amount to get a substring from PWSTR?
Use std::wstring instead of std::string and get the same functionality.

However, if you are using a static control instead of an edit control windows automatically can show ellipsis for you if the text does not fit:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb760773(v=vs.85).aspx

A PWSTR is a pointer to wchar_t type.
Last edited on
Thanks, Modoran.
Topic archived. No new replies allowed.