Thread overview
Win32 bindings
Mar 31, 2015
Charles
Mar 31, 2015
rumbu
Apr 01, 2015
Vladimir Panteleev
Apr 01, 2015
Charles
Apr 01, 2015
Vladimir Panteleev
Sep 03, 2015
Prudence
Sep 04, 2015
Kagamin
March 31, 2015
Hi guys,

What is the best (and/or official) source for win32 bindings?

I know there's this github project: https://github.com/AndrejMitrovic/DWinProgramming; however, it hasn't been touched in about 2 years. It's currently linked on the wiki (http://wiki.dlang.org/D_for_Win32).

I'm also aware that there's core.sys.windows.windows, but the documentation for this page is less than helpful: http://dlang.org/library/core/sys/windows/windows.html. It also seems to be missing portions of it that'd be useful (see github here: https://github.com/D-Programming-Language/druntime/tree/master/src/core/sys/windows).

So, perhaps, a better question is what do you use for win32 bindings? Are there any additional dependencies when building apps with either of these (beyond something like user32.dll for example)?

Thanks,
Charles
March 31, 2015
On Tuesday, 31 March 2015 at 17:20:05 UTC, Charles wrote:
> Hi guys,
>
> What is the best (and/or official) source for win32 bindings?
>
> I know there's this github project: https://github.com/AndrejMitrovic/DWinProgramming; however, it hasn't been touched in about 2 years. It's currently linked on the wiki (http://wiki.dlang.org/D_for_Win32).
>
> I'm also aware that there's core.sys.windows.windows, but the documentation for this page is less than helpful: http://dlang.org/library/core/sys/windows/windows.html. It also seems to be missing portions of it that'd be useful (see github here: https://github.com/D-Programming-Language/druntime/tree/master/src/core/sys/windows).
>
> So, perhaps, a better question is what do you use for win32 bindings? Are there any additional dependencies when building apps with either of these (beyond something like user32.dll for example)?
>
> Thanks,
> Charles

AFAIK, the bindings linked on the wiki page are the best you can get. If you want to use static linking, you must also download the latest Windows SDK (8.1) and transform winapi libs in OMF format using coffimplib (http://www.digitalmars.com/ctg/coffimplib.html)

Finally I ended up to use dynamic linking. When I need a function not present in std.c.windows, I translate it to D from windows C headers and I use the good old way to load it (LoadLibrary/GetProcAddress). If you are using Visual D, there is a nice menu item named "C++ Convert selection" that you can use to translate in place structs or enums copied from win C++ headers.




April 01, 2015
On Tuesday, 31 March 2015 at 17:20:05 UTC, Charles wrote:
> Hi guys,
>
> What is the best (and/or official) source for win32 bindings?

http://www.dsource.org/projects/bindings/wiki/WindowsApi

> So, perhaps, a better question is what do you use for win32 bindings? Are there any additional dependencies when building apps with either of these (beyond something like user32.dll for example)?

For some functions, you'll need import libraries. You can get them from the same project as in the above link, create your own from .def files, or use implib/coffimplib.
April 01, 2015
> http://www.dsource.org/projects/bindings/wiki/WindowsApi

Thanks for this! I guess my brain was wrong thinking it'd be in http://code.dlang.org if it was still being maintained.

> For some functions, you'll need import libraries. You can get them from the same project as in the above link, create your own from .def files, or use implib/coffimplib.

Are the default libraries in dmd2\windows\lib not current or something?
April 01, 2015
On Wednesday, 1 April 2015 at 01:09:11 UTC, Charles wrote:
> Are the default libraries in dmd2\windows\lib not current or something?

Those only cover a small number of DLLs, and even those partially.
September 03, 2015
On Wednesday, 1 April 2015 at 01:53:22 UTC, Vladimir Panteleev wrote:
> On Wednesday, 1 April 2015 at 01:09:11 UTC, Charles wrote:
>> Are the default libraries in dmd2\windows\lib not current or something?
>
> Those only cover a small number of DLLs, and even those partially.

There should be a respository for these things with versioning and architecture support... it's kinda ridiculous that one has to go through so much trouble just to get an app up an running. How does D expect to compete in such cases?
September 04, 2015
https://github.com/etcimon/windows-headers