On Thursday, 19 April 2018 at 08:13:00 UTC, Andrey wrote:
Hello,
I wrote a small test code with WinApi:

----------------------------------------------------
import core.runtime;
import std.utf;

import core.sys.windows.windows;
import core.sys.windows.wingdi;

class Test
{
    public this() nothrow
    {

    }
}

extern(Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int nCmdShow)
{
    new Test(); // error is here
    return 0;
}
----------------------------------------------------

When I run it, there is an error: Program exited with code 1.

If I comment "new Test();" - no error happens. Why?

The run-time is not already initialized but the "new" operator relies on it.

Reply via email to