make D windows-aware

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Mar 22 17:42:57 PST 2006


"Regan Heath" <regan at netwin.co.nz> wrote in message 
news:ops6uelhqc23k2f5 at nrage.netwin.co.nz...
> Can you catch them all in WinMain i.e.
>
> try {
>   ..main..
> } catch(Object o) {
>   MessageBox(...
> }

If I use the method proposed by Sean, I'd have to catch the exceptions in my 
own main function, as the dmain catches them and prints them to the console. 
i.e.

extern(C) main(..)

int WinMain(..)
{
    return main(1, &cmdline);
}

void main()
{
    try
    {
        crap
    }
    catch(Exception e)
    {
        MessageBox("oh man" ~ e.toString());
    }
}

Pretty ugly. 





More information about the Digitalmars-d mailing list