Thread overview
What is the Most Effective Tool to Convert WinAPI Headers?
3 days ago
Jacob Carlborg
6 days ago
DanielG
6 days ago
Paulo Pinto
6 days ago
Andre Pany
October 12
I'm currently working on a Phobos issue that necessitates a function whose declaration is found in Fileapi.h. Unfortunately, druntime doesn't contain the header's D counterpart. I know there are a few tools to help automate this process, but which one would has been known to work well with Windows' headers?
October 12
Dang. Should've posted this in learn.
October 12
On Monday, 12 October 2020 at 17:28:39 UTC, starcanopy wrote:
> I'm currently working on a Phobos issue that necessitates a function whose declaration is found in Fileapi.h. Unfortunately, druntime doesn't contain the header's D counterpart. I know there are a few tools to help automate this process, but which one would has been known to work well with Windows' headers?

Try using the dpp library.
-Alex
October 13
On 13/10/2020 6:28 AM, starcanopy wrote:
> I'm currently working on a Phobos issue that necessitates a function whose declaration is found in Fileapi.h. Unfortunately, druntime doesn't contain the header's D counterpart. I know there are a few tools to help automate this process, but which one would has been known to work well with Windows' headers?

You shouldn't need a tool for this.

It looks pretty straight forward to writing a binding for it.

https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/fileapi.h
October 13
On Monday, 12 October 2020 at 18:04:12 UTC, 12345swordy wrote:
> On Monday, 12 October 2020 at 17:28:39 UTC, starcanopy wrote:
>> I'm currently working on a Phobos issue that necessitates a function whose declaration is found in Fileapi.h. Unfortunately, druntime doesn't contain the header's D counterpart. I know there are a few tools to help automate this process, but which one would has been known to work well with Windows' headers?
>
> Try using the dpp library.
> -Alex

It's been a while, but I'll give it a shot. Never had much luck with it, even for macro-lite headers. Thanks.
October 13
On Tuesday, 13 October 2020 at 00:46:32 UTC, rikki cattermole wrote:
> On 13/10/2020 6:28 AM, starcanopy wrote:
>> I'm currently working on a Phobos issue that necessitates a function whose declaration is found in Fileapi.h. Unfortunately, druntime doesn't contain the header's D counterpart. I know there are a few tools to help automate this process, but which one would has been known to work well with Windows' headers?
>
> You shouldn't need a tool for this.
>
> It looks pretty straight forward to writing a binding for it.
>
> https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-headers/include/fileapi.h

True, but I've been meaning to familiarize myself with the pertinent tooling, and this is an okay-ish example for such a purpose. Worst-case I'll do it "by hand."
6 days ago
Ideally somebody would create a WinRT "projection" for Dlang. As I understand it there are some metadata (winmd) files that describe the full COM API surface, so idiomatic binding generation can be automated.

I've not gone any deeper but on the surface it sounds roughly similar to how GTK bindings are produced from GIR metadata.

6 days ago
On Wednesday, 14 October 2020 at 04:49:14 UTC, DanielG wrote:
> Ideally somebody would create a WinRT "projection" for Dlang. As I understand it there are some metadata (winmd) files that describe the full COM API surface, so idiomatic binding generation can be automated.
>
> I've not gone any deeper but on the surface it sounds roughly similar to how GTK bindings are produced from GIR metadata.

Indeed, it is the next COM major improvement.

Basically .NET metadata replaces COM type libraries (TLB), and in the process COM ABI was extended to support basically anything from Common Language Subset (CLS) from .NET (as in types).

So UWP also supports enumerations and generics for example.

Initially the support for projections was built into .NET, Chakra and VC++ toolings, while everyone else was left wondering how to make them.

Now with that whole Project Reunion reboot of the stack, that infrastructure is available for others.

You can start here,

https://github.com/microsoft/xlang

With parser and all Windows SDK first party languages available to learn from.
6 days ago
On Wednesday, 14 October 2020 at 04:49:14 UTC, DanielG wrote:
> Ideally somebody would create a WinRT "projection" for Dlang. As I understand it there are some metadata (winmd) files that describe the full COM API surface, so idiomatic binding generation can be automated.
>
> I've not gone any deeper but on the surface it sounds roughly similar to how GTK bindings are produced from GIR metadata.

There is some work done here by WebFreak
https://github.com/WebFreak001/dwinrt

And also here:
https://github.com/LightBender/DWinRT

Kind regards
Andre
3 days ago
On 2020-10-13 18:09, starcanopy wrote:

> It's been a while, but I'll give it a shot. Never had much luck with it, even for macro-lite headers. Thanks.

You could try DStep [1] as well.

[1] https://github.com/jacob-carlborg/dstep

-- 
/Jacob Carlborg