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 pointer but length as well, you
usually call them like this:

  wchar[] foo = "some string";
  FuncW(foo.ptr, foo.length);

To get a string from a function you need a buffer:

  auto buf = new wchar[MAX_PATH];
  buf.length = GetModuleFileNameW(h, buf.ptr, buf.length);

Reply via email to