Skip to content

Stdout infinite loop and crash in Windows program #63

Description

@jminer

With the following program:

import tango.io.Stdout;

extern(Windows)
int MessageBoxW(void* hWnd, const(wchar)* lpText, const(wchar)* lpCaption, uint uType);

void main() {
    Stdout.format("Bye, world").newline;
    MessageBoxW(null, "The program opened.", "Opened", 0);
}

On Windows 7 64-bit, if you compile the program as a Windows program instead of a console program using

rdmd -ofmain.exe -I..\Tango ..\Tango\libtango-dmd.lib -L/EXETYPE:NT -L/SUBSYSTEM:WINDOWS:4.0 main.d

Then when the program is run from the console, the process will go into an infinite loop instead of exiting. If you try double clicking the program in Explorer, it silently dies, presumably because it threw an exception. I tried on Windows XP, and the program opens when double clicked but still goes into an infinite loop at exit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions