Re: Windows - ZeroMemory macro

2012-05-27 Thread Andrej Mitrovic
On 5/27/12, dnewbie wrote: > In C I can write > > OPENFILENAME ofn; > ZeroMemory(&ofn, sizeof(ofn)); > > In D, there is no ZeroMemory. Please help me. > I've never had to use this with WinAPI. The default .init value usually works well, especially if the struct is well-defined, e.g.: struct Foo

Re: Windows - ZeroMemory macro

2012-05-27 Thread dnewbie
On Sunday, 27 May 2012 at 03:55:58 UTC, jerro wrote: On Sunday, 27 May 2012 at 03:29:17 UTC, dnewbie wrote: In C I can write OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(ofn)); In D, there is no ZeroMemory. Please help me. You could use c memset: import std.c.string; memset(cast(void*)&ofn, 0,

Re: Windows - ZeroMemory macro

2012-05-26 Thread jerro
On Sunday, 27 May 2012 at 03:29:17 UTC, dnewbie wrote: In C I can write OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(ofn)); In D, there is no ZeroMemory. Please help me. You could use c memset: import std.c.string; memset(cast(void*)&ofn, 0, ofn.sizeof); or this: (cast(byte*)& a)[0 .. a.sizeo

Windows - ZeroMemory macro

2012-05-26 Thread dnewbie
In C I can write OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(ofn)); In D, there is no ZeroMemory. Please help me.