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;
        writeln("Hello");
        stdout.flush; //exception
        readln; //exception
        return 0;
}

It shows the console window and waits for user input at readln.

If I try to compile this to 64bit target or with LDC (both 32 and 64) it gets privileged instruction exception at stdout.flush. If I comment out flush then it fails at readln.

Is there a way to fix this? I don't wanna lose the console window even on 64bit.

Thanks!

Reply via email to