wchar[] and wchar*

Kagamin spam at here.lot
Fri Apr 10 05:41:13 PDT 2009


novice2 Wrote:

> Kagamin Wrote:
> 
> > novice2 Wrote:
> > 
> > > but sometime wchar* is zero-terminated strings (LPWSTR)
> > 
> > when?
> 
> everytime, when you see function with LPWSTR without size passing
> 
> for example:
> 
> SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
> 
> GetShortPathNameW( IN LPCWSTR lpszLongPath, OUT LPWSTR  lpszShortPath, IN DWORD cchBuffer);
> 
> GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD cchBuffer);
> 
> etc etc etc
> 

these functions don't require output buffer to be null-terminated, because it's an *out* buffer, not inout, see example in msdn.


More information about the Digitalmars-d-learn mailing list