www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Win32 bindings

reply "Charles" <csmith.ku2013 gmail.com> writes:
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
Mar 31 2015
next sibling parent "rumbu" <rumbu rumbu.ro> writes:
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.
Mar 31 2015
prev sibling parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
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.
Mar 31 2015
parent reply "Charles" <csmith.ku2013 gmail.com> writes:
 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?
Mar 31 2015
parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
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.
Mar 31 2015
parent reply "Prudence" <Pursuit Happyness.All> writes:
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?
Sep 03 2015
parent "Kagamin" <spam here.lot> writes:
https://github.com/etcimon/windows-headers
Sep 04 2015