Thanks Ali.

As always, your examples and explanations are amazingly clear and "easy to understand".


On Monday, 15 September 2014 at 23:57:59 UTC, Ali Çehreli wrote:
You must make use of the returned value to slice your wstring. Something like this (not compiled):

auto actualLength = GetUserNameW(lpwszUsername.ptr, &dUsername2);
    auto userName = lpwszUsername[0..actualLength];

Otherwise, D knows that lpwszUsername is a 254-char string and will try to print all of it.

Ali

Reply via email to