June 30, 2014 Re: Why is the Win32 boilerplate the way it is? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Monday, 30 June 2014 at 15:19:39 UTC, Adam D. Ruppe wrote: > On Monday, 30 June 2014 at 15:14:24 UTC, Jeremy Sorensen wrote: >> documentation means "import core.sys.windows.windwos" > > The Windows headers that come with D are pathetically minimal. You'll need to grab a more complete win32 header OR copy/paste the individual prototypes off MSDN and use them that way. > This is a more complete set of windows api headers https://github.com/AndrejMitrovic/WindowsAPI |
July 01, 2014 Re: Why is the Win32 boilerplate the way it is? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Monday, 30 June 2014 at 15:19:39 UTC, Adam D. Ruppe wrote:
> The Windows headers that come with D are pathetically minimal. You'll need to grab a more complete win32 header OR copy/paste the individual prototypes off MSDN and use them that way.
>
> So add this to your D file after importing core.sys.windows.windows:
>
> extern(Windows)
> void GetStartupInfoA(STARTUPINFO*); // the pathetic druntime Windows headers define TCHAR as ascii, so we'll use the A version
>
>
> And try compiling it. If it complains that STARTUPINFO is undefined too, copy its prototype in:
>
> struct STARTUPINFO {
> DWORD cb;
> LPTSTR lpReserved;
> LPTSTR lpDesktop;
> LPTSTR lpTitle;
> DWORD dwX;
> DWORD dwY;
> DWORD dwXSize;
> DWORD dwYSize;
> DWORD dwXCountChars;
> DWORD dwYCountChars;
> DWORD dwFillAttribute;
> DWORD dwFlags;
> WORD wShowWindow;
> WORD cbReserved2;
> LPBYTE lpReserved2;
> HANDLE hStdInput;
> HANDLE hStdOutput;
> HANDLE hStdError;
> }
>
>
> And that should make it work.
Yup that worked
|
July 02, 2014 Re: Why is the Win32 boilerplate the way it is? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy Sorensen | On Sunday, 29 June 2014 at 15:06:25 UTC, Jeremy Sorensen wrote:
> The only question I have is what happens when you use SUBSYSTEM:WINDOWS:4.0 (Which I understand means XP or higher) and the program runs on something older?
Windows XP is version 5.1.
4.0 was Windows NT 4 (which I believe was the NT-family Windows version preceding Windows 2000).
|
July 02, 2014 Re: Why is the Win32 boilerplate the way it is? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jason King | On Monday, 30 June 2014 at 15:58:50 UTC, Jason King wrote: > On Monday, 30 June 2014 at 15:19:39 UTC, Adam D. Ruppe wrote: >> On Monday, 30 June 2014 at 15:14:24 UTC, Jeremy Sorensen wrote: >>> documentation means "import core.sys.windows.windwos" >> >> The Windows headers that come with D are pathetically minimal. You'll need to grab a more complete win32 header OR copy/paste the individual prototypes off MSDN and use them that way. >> > This is a more complete set of windows api headers > https://github.com/AndrejMitrovic/WindowsAPI I have a mirror which updates automatically, and is usable as a git submodule: https://github.com/CS-svnmirror/dsource-bindings-win32 |
Copyright © 1999-2021 by the D Language Foundation