Re: Why is the Win32 boilerplate the way it is?

2014-07-02 Thread Vladimir Panteleev via Digitalmars-d-learn
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

Re: Why is the Win32 boilerplate the way it is?

2014-06-30 Thread Jason King via Digitalmars-d-learn
On Monday, 30 June 2014 at 05:30:23 UTC, Jeremy Sorensen wrote: Assuming the nCmdShow thing isn't a problem I see no reason why the wiki should tell people to use WinMain at all. If MSDN is to be believed VOID WINAPI GetStartupInfo( _Out_ LPSTARTUPINFO lpStartupInfo ); will get you nCmdShow

Re: Why is the Win32 boilerplate the way it is?

2014-06-30 Thread Jeremy Sorensen via Digitalmars-d-learn
If MSDN is to be believed VOID WINAPI GetStartupInfo( _Out_ LPSTARTUPINFO lpStartupInfo ); will get you nCmdShow and lots of other goodies. I keep getting Error: undefined identifier GetStartupInfo (or GetStartupInfoA, or GetStartupInfoW). According to MSDN it should be available from

Re: Why is the Win32 boilerplate the way it is?

2014-06-30 Thread Adam D. Ruppe via Digitalmars-d-learn
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

Re: Why is the Win32 boilerplate the way it is?

2014-06-30 Thread Jason King via Digitalmars-d-learn
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

Re: Why is the Win32 boilerplate the way it is?

2014-06-30 Thread Jeremy Sorensen via Digitalmars-d-learn
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

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-29 06:47, Jeremy Sorensen wrote: I found an example of boilerplate code for Win32 programming in D here: http://wiki.dlang.org/D_for_Win32 I have some questions. 1. It appears that the call to myWinMain from WinMain is to ensure that any exception or error is caught. At first glance

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jeremy Sorensen via Digitalmars-d-learn
On Sunday, 29 June 2014 at 07:51:50 UTC, Jacob Carlborg wrote: You don't need to use WinMain. You can use a plain D main function and add the -L/SUBSYSTEM:WINDOWS:4.0 link flag to suppress the console. There are API's to get access to the arguments passed to WinMain, if necessary. OK so I

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Trass3r via Digitalmars-d-learn
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? WinXP is dead :)

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jacob Carlborg via Digitalmars-d-learn
On 2014-06-29 17:06, 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? Will you get an error message or just silent failure? Actually, I don't know. You could try

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jeremy Sorensen via Digitalmars-d-learn
On Sunday, 29 June 2014 at 18:16:05 UTC, Jacob Carlborg wrote: On 2014-06-29 17:06, 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? Will you get an error

Re: Why is the Win32 boilerplate the way it is?

2014-06-29 Thread Jeremy Sorensen via Digitalmars-d-learn
On Sunday, 29 June 2014 at 07:51:50 UTC, Jacob Carlborg wrote: You don't need to use WinMain. You can use a plain D main function and add the -L/SUBSYSTEM:WINDOWS:4.0 link flag to suppress the console. There are API's to get access to the arguments passed to WinMain, if necessary. Thanks

Why is the Win32 boilerplate the way it is?

2014-06-28 Thread Jeremy Sorensen via Digitalmars-d-learn
I found an example of boilerplate code for Win32 programming in D here: http://wiki.dlang.org/D_for_Win32 I have some questions. 1. It appears that the call to myWinMain from WinMain is to ensure that any exception or error is caught. At first glance it looks like this is to ensure that