When is the Win API supported?

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 25 10:40:14 PST 2016


On Monday, 25 January 2016 at 18:34:30 UTC, Igor wrote:
> On Monday, 25 January 2016 at 18:18:48 UTC, Vladimir Panteleev 
> wrote:
>> On Monday, 25 January 2016 at 18:09:47 UTC, Igor wrote:
>>> On Monday, 25 January 2016 at 02:21:49 UTC, Rikki Cattermole 
>>> wrote:
>>>> On 25/01/16 2:46 PM, Igor wrote:
>>>>> When will the proper Win API be included in D? About how 
>>>>> long(months,
>>>>> years?)? Does it support seamless narrow and wide 
>>>>> characters?
>>>>>
>>>>> I am not referring to the defunct win32 support already 
>>>>> included.
>>>>
>>>> You mean the MingW based bindings that is in 2.070?
>>>> https://github.com/D-Programming-Language/druntime/tree/v2.070.0-b2/src/core/sys/windows
>>>>
>>>> The only issue is for -m32 with import libs.
>>
>> I've included the .def files that came with the Win32 
>> bindings, and added them to the build, so many import libs 
>> will be supported already.
>>
>>> How do I use it? I can't find any docs on it(The D page, at 
>>> least doesn't seem to have anything for windows in phobos 
>>> except charset.
>>
>> When in C you would `#include <foo.h>`, in D you can `import 
>> core.sys.windows.foo;`, then just use it exactly like from C.
>
> Where are the docs for this?

There currently aren't any.

> http://dlang.org/phobos-prerelease/index.html
>
> doesn't show anything about sys in core.

The core.sys package mirrors various C system headers. As such, 
you can consult the C documentation instead. Though I agree, it 
would be nice to have at least an overview for each module. Feel 
free to file a bug or contribute.

> I remember seeing somewhere that win32 api was included in dmd 
> but that it wasn't working and was suppose to be updated. I 
> would like to try it out but I can't find any working 
> information about it.
>
> If I add `import core.sys.windows;`
>
> Dmd says `Error: module windows is in file 'core\sys\windows.d' 
> which cannot be read`.
>
> I am using DMD Beta 2.070.0-b2

core.sys.windows is a package (without a package.d), so you can't 
import it directly. You probably want to import 
core.sys.windows.windows, that will import most common headers 
(as described above, it is the equivalent of "#include 
<windows.h>").



More information about the Digitalmars-d mailing list