www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Getting the missing Windows functions

reply "Matt" <webwraith fastmail.fm> writes:
I have noticed that a number of the current Windows C functions 
are not in core.sys.windows.windows.d

I tried adding them to the module (after setting up source 
control so I can roll back any errors I might make), and found 
that Optlink wasn't finding the functions to resolve the symbols 
to. How do I go about getting the libraries that have the missing 
functionality, and once I have it, is it simply a case of editing 
the above module to make them available?
Oct 06 2013
parent reply "Andrej Mitrovic" <andrej.mitrovich gmail.com> writes:
On Sunday, 6 October 2013 at 19:44:16 UTC, Matt wrote:
 I have noticed that a number of the current Windows C functions 
 are not in core.sys.windows.windows.d

 I tried adding them to the module (after setting up source 
 control so I can roll back any errors I might make), and found 
 that Optlink wasn't finding the functions to resolve the 
 symbols to. How do I go about getting the libraries that have 
 the missing functionality, and once I have it, is it simply a 
 case of editing the above module to make them available?
Please see the following project for an updated binding to Windows functions: http://www.dsource.org/projects/bindings/wiki/WindowsApi Typically you link to one of the distributed Windows DLLs via an import library, e.g. you would pass "kernel32.lib" at the command-line when calling DMD for any functions in the kernel32 DLL. kernel32.lib is the import lib, and it's distributed along with DMD.
Oct 06 2013
parent reply "Matt" <webwraith fastmail.fm> writes:
 Typically you link to one of the distributed Windows DLLs via 
 an import library, e.g. you would pass "kernel32.lib" at the 
 command-line when calling DMD for any functions in the kernel32 
 DLL. kernel32.lib is the import lib, and it's distributed along 
 with DMD.
I have never had to specify any Windows libs for linking under DMD. What is different about these?
Oct 06 2013
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 10/7/13, Matt <webwraith fastmail.fm> wrote:
 I have never had to specify any Windows libs for linking under
 DMD. What is different about these?
DMD links in user32.lib and kernel32.lib by default. But if you want to use other libs like GDI you're going to have to pass them at the command line.
Oct 07 2013
parent reply "Matt" <webwraith fastmail.fm> writes:
On Monday, 7 October 2013 at 14:45:35 UTC, Andrej Mitrovic wrote:
 On 10/7/13, Matt <webwraith fastmail.fm> wrote:
 I have never had to specify any Windows libs for linking under
 DMD. What is different about these?
DMD links in user32.lib and kernel32.lib by default. But if you want to use other libs like GDI you're going to have to pass them at the command line.
The missing functions (or at least the one I'm interested in at the moment) that I'm trying to use are supposed to be IN kernel32, and have been in there since Windows Vista. That's why I'm a little confused.
Oct 07 2013
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 10/7/13, Matt <webwraith fastmail.fm> wrote:
 The missing functions (or at least the one I'm interested in at
 the moment) that I'm trying to use are supposed to be IN
 kernel32, and have been in there since Windows Vista. That's why
 I'm a little confused.
The kernel32.lib distributed with DMD is likely out of date. See: http://d.puremagic.com/issues/show_bug.cgi?id=6625
Oct 07 2013
parent reply Mike Parker <aldacron gmail.com> writes:
On 10/8/2013 6:57 AM, Andrej Mitrovic wrote:
 On 10/7/13, Matt <webwraith fastmail.fm> wrote:
 The missing functions (or at least the one I'm interested in at
 the moment) that I'm trying to use are supposed to be IN
 kernel32, and have been in there since Windows Vista. That's why
 I'm a little confused.
The kernel32.lib distributed with DMD is likely out of date. See: http://d.puremagic.com/issues/show_bug.cgi?id=6625
It's very out of date. When I need Windows functions that are missing from the DMD libs, I prototype them as function pointers and load them dynamically. It's a one-off investment for each function and I don't need many of them, so no big deal.
Oct 08 2013
parent "dnewbie" <run3 myopera.com> writes:
On Tuesday, 8 October 2013 at 08:54:44 UTC, Mike Parker wrote:
 On 10/8/2013 6:57 AM, Andrej Mitrovic wrote:
 On 10/7/13, Matt <webwraith fastmail.fm> wrote:
 The missing functions (or at least the one I'm interested in 
 at
 the moment) that I'm trying to use are supposed to be IN
 kernel32, and have been in there since Windows Vista. That's 
 why
 I'm a little confused.
The kernel32.lib distributed with DMD is likely out of date. See: http://d.puremagic.com/issues/show_bug.cgi?id=6625
It's very out of date. When I need Windows functions that are missing from the DMD libs, I prototype them as function pointers and load them dynamically. It's a one-off investment for each function and I don't need many of them, so no big deal.
I always run this when I install a new dmd cd C:\D\dmd2\windows\lib\ coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\advapi32.lib" advapi32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\comctl32.lib" comctl32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\comdlg32.lib" comdlg32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\gdi32.lib" gdi32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\kernel32.lib" kernel32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\shell32.lib" shell32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\shlwapi.lib" shlwapi.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\user32.lib" user32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\ws2_32.lib" ws2_32.lib coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\wsock32.lib" wsock32.lib
Oct 08 2013