Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-08 Thread realhet via Digitalmars-d-learn
On Friday, 8 June 2018 at 03:08:21 UTC, Mike Franklin wrote: I recall similar issues with a project I was working on, but I don't remember all the details now. Anyway, I ended up with this in the end. Using main() instead of WinMain() did the trick too. Also it's simpler, so I choose this

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-08 Thread realhet via Digitalmars-d-learn
On Friday, 8 June 2018 at 02:44:13 UTC, Mike Parker wrote: ...you can get it with this: dmd -m64 -L/SUBSYSTEM:console -L/ENTRY:WinMainCRTStartup foo.d Thank You! It works with LDC -m64 as well. And now that I repaired my VCRedist2015 the bat file test (my second code example) is working too.

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread Mike Franklin via Digitalmars-d-learn
On Thursday, 7 June 2018 at 19:19:55 UTC, realhet wrote: Hi, The following narrow test program works fine when compiled with DMD to 32bit target: import std.stdio, core.sys.windows.windows, core.runtime; extern(Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 7 June 2018 at 19:19:55 UTC, realhet wrote: Hi, The following narrow test program works fine when compiled with DMD to 32bit target: import std.stdio, core.sys.windows.windows, core.runtime; extern(Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread realhet via Digitalmars-d-learn
On Thursday, 7 June 2018 at 23:25:45 UTC, Steven Schveighoffer wrote: ... The WinMain exported function works alone well and on 32bit it also does the console. On 64 I also tried AllocConsole, but fail. I get the Console handle with GetConsoleHandle, it sends back a nonzero value. But as I

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/7/18 7:16 PM, realhet wrote: On Thursday, 7 June 2018 at 19:42:05 UTC, Steven Schveighoffer wrote: Are you just compiling the 32-bit dmd version with default flags? Yes, no flags at all and it defaults to a 32bit target. I can use the console and able to make windows, and able to setup an

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread realhet via Digitalmars-d-learn
On Thursday, 7 June 2018 at 19:42:05 UTC, Steven Schveighoffer wrote: Are you just compiling the 32-bit dmd version with default flags? Yes, no flags at all and it defaults to a 32bit target. I can use the console and able to make windows, and able to setup an opengl window too. The console

Re: Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/7/18 3:19 PM, realhet wrote: Hi, The following narrow test program works fine when compiled with DMD to 32bit target: import std.stdio, core.sys.windows.windows, core.runtime; extern(Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) {   

Using stdin/out in a windows application bugs only when compiled to 64bit.

2018-06-07 Thread realhet via Digitalmars-d-learn
Hi, The following narrow test program works fine when compiled with DMD to 32bit target: import std.stdio, core.sys.windows.windows, core.runtime; extern(Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) { Runtime.initialize;