Is there an equivalent to toStringz for wide strings?
Kagamin
spam at here.lot
Tue Apr 5 05:10:12 PDT 2011
Andrej Mitrovic Wrote:
> I think I'd need a toWStringz function, or maybe toStringz can be made more clever and figure out that I'm passing a wstring and return a null-terminated wchar*.
>
> Currently I'm using wstrings and appending the null terminator by hand, e.g.:
>
> wstring appName = "DMapp" ~ "\0";
>
> Some WinAPI functions in unicode form, such as CreateWindowExW, expect a wchar*. So in the above case I just pass `appName.ptr`. But it would be convenient not having to append the null terminator prematurely.
toUTF16z
it was in windows examples somewhere, I suppose.
More information about the Digitalmars-d-learn
mailing list