Re: wchar[] and wchar*

2009-04-11 Thread Kagamin
novice2 Wrote: > please, just advice me, how to write program in D with many D <--> C (include > Windows) interaction to keep D code simple. > some one in this forum advice me use wchar[] and no problem with Windows API. > i just novice. I want to say, you do unneded thing converting output buf

Re: wchar[] and wchar*

2009-04-11 Thread novice2
Kagamin Wrote: > > this is readonly string. You can make it by simply appending "\0". sorry, but i not understand, what you wan to say to me :( if you want - just say. my original post was: thank you Sergey >but sometime wchar* is zero-terminated strings (LPWSTR) >i feel lack of toStringz(wchar

Re: wchar[] and wchar*

2009-04-11 Thread Kagamin
novice2 Wrote: > http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx > > citate: > pszPath > [out] A pointer to a null-terminated string of length MAX_PATH which will > receive the path. > > How i can determine the length of returned path string? > I know only one way - look for 0,

Re: wchar[] and wchar*

2009-04-10 Thread novice2
Kagamin Wrote: > > > > SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR > > pszPath); > > > > these functions don't require output buffer to be null-terminated, because > it's an *out* buffer, not inout, see example in msdn. http://msdn.microsoft.com/en-us/library/

Re: wchar[] and wchar*

2009-04-10 Thread Kagamin
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,

Re: wchar[] and wchar*

2009-04-09 Thread novice2
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

Re: wchar[] and wchar*

2009-04-09 Thread Kagamin
novice2 Wrote: > but sometime wchar* is zero-terminated strings (LPWSTR) when?

Re: wchar[] and wchar*

2009-04-09 Thread downs
Jarrett Billingsley wrote: > On Tue, Apr 7, 2009 at 3:09 PM, novice2 wrote: >> thank you Sergey >> >> but sometime wchar* is zero-terminated strings (LPWSTR) >> i feel lack of toStringz(wchar[]) and toString(wchar*) functions in phobos > > Yeah, that does suck, doesn't it? > > I wouldn't want to

Re: wchar[] and wchar*

2009-04-08 Thread novice2
thank you, Denis

Re: wchar[] and wchar*

2009-04-07 Thread Denis Koroskin
(I wonder why this message wasn't sent hours ago and stuck in my mailbox, but here it goes:) On Tue, 07 Apr 2009 09:32:59 +0400, novice2 wrote: hi! could you advice me, please, what techniques should be used while working with D wchar[] and C wchar* (e.g. Windows unicode API named ...W()).

Re: wchar[] and wchar*

2009-04-07 Thread Jarrett Billingsley
On Tue, Apr 7, 2009 at 3:09 PM, novice2 wrote: > thank you Sergey > > but sometime wchar* is zero-terminated strings (LPWSTR) > i feel lack of toStringz(wchar[]) and toString(wchar*) functions in phobos Yeah, that does suck, doesn't it? I wouldn't want to mention the 'T' word for fear of Downs a

Re: wchar[] and wchar*

2009-04-07 Thread novice2
thank you Sergey but sometime wchar* is zero-terminated strings (LPWSTR) i feel lack of toStringz(wchar[]) and toString(wchar*) functions in phobos or i missed something?

Re: wchar[] and wchar*

2009-04-07 Thread Sergey Gromov
Tue, 07 Apr 2009 01:32:59 -0400, novice2 wrote: > hi! > could you advice me, please, what techniques should be used > while working with D wchar[] and C wchar* (e.g. Windows unicode API named > ...W()). > > how to pass wchar[] to FuncW(wchar*) and back? Since most of FuncW require not only the

wchar[] and wchar*

2009-04-06 Thread novice2
hi! could you advice me, please, what techniques should be used while working with D wchar[] and C wchar* (e.g. Windows unicode API named ...W()). how to pass wchar[] to FuncW(wchar*) and back? thanks!