Jump to page: 1 25  
Page
Thread overview
WinMain
Feb 27, 2004
Stewart Gordon
Feb 27, 2004
SpookyET
Feb 27, 2004
Stewart Gordon
Feb 27, 2004
Roel Mathys
Feb 28, 2004
Phill
Feb 29, 2004
C
Mar 01, 2004
Matthew
Mar 01, 2004
Phill
Mar 01, 2004
Matthew
Mar 01, 2004
John Reimer
Mar 01, 2004
Matthew
OT God Re: WinMain
Mar 01, 2004
Ilya Minkov
Mar 02, 2004
John Reimer
Mar 02, 2004
Ant
Mar 02, 2004
John Reimer
Mar 02, 2004
Ilya Minkov
Mar 02, 2004
Matthew
Mar 02, 2004
J Anderson
Mar 02, 2004
Ilya Minkov
Mar 02, 2004
J Anderson
Mar 02, 2004
John Reimer
Re: OT God and evolution
Mar 02, 2004
John Reimer
Mar 02, 2004
Ant
OT Giddy Re: OT God Re: WinMain
Mar 02, 2004
Vathix
Mar 02, 2004
John Reimer
Mar 01, 2004
Phill
Mar 01, 2004
John Reimer
Mar 01, 2004
Phill
Mar 01, 2004
John Reimer
Mar 01, 2004
Matthew
Mar 01, 2004
John Reimer
Mar 01, 2004
Matthew
Feb 27, 2004
Andy Friesen
Feb 28, 2004
Matthew
Feb 28, 2004
StuartD
Feb 28, 2004
Phill
Feb 29, 2004
Phill
Feb 29, 2004
Matthew
Mar 02, 2004
Stewart Gordon
February 27, 2004
The website gives this form for WinMain:

----------
import std.c.windows.windows;

extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void _minit();
extern (C) void _moduleCtor();
extern (C) void _moduleUnitTests();

extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
		LPSTR lpCmdLine, int nCmdShow) {
    int result;

    gc_init();
    _minit();

    try {
	_moduleCtor();
	_moduleUnitTests();

	result = doit();
    }

    catch (Object o) {
	MessageBoxA(null, (char *)o.toString(), "Error",
		    MB_OK | MB_ICONEXCLAMATION);
	result = 0;
    }

    gc_term();
    return result;
}
----------

I've been using a slightly different version, which works as far as I
can see:

----------
import std.c.windows.windows;

extern (C) void gc_init();
extern (C) void gc_term();
extern (C) void _minit();
extern (C) void _moduleCtor();
extern (C) void _moduleUnitTests();

extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
		LPSTR lpCmdLine, int nCmdShow) {
    gc_init();
    _minit();

    try {
	_moduleCtor();
	_moduleUnitTests();

	return doit();
    }

    catch (Object o) {
	MessageBoxA(null, (char *)o.toString(), "Error",
		    MB_OK | MB_ICONEXCLAMATION);
	return 0;
    }

    finally {
	gc_term();
    }
}
----------

But is there any possible reason not to use this form?  If not, I'm
inclined to suggest putting this one in the documentation in place of
the other one, as it seems neater and more logical.

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment.  Please keep
replies on the 'group where everyone may benefit.
February 27, 2004
In Visual C++, you can set the entry point to main intead of WinMain.

On Fri, 27 Feb 2004 13:45:57 +0000, Stewart Gordon <smjg_1998@yahoo.com> wrote:

> The website gives this form for WinMain:
>
> ----------
> import std.c.windows.windows;
>
> extern (C) void gc_init();
> extern (C) void gc_term();
> extern (C) void _minit();
> extern (C) void _moduleCtor();
> extern (C) void _moduleUnitTests();
>
> extern (Windows)
> int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
> 		LPSTR lpCmdLine, int nCmdShow) {
>      int result;
>
>      gc_init();
>      _minit();
>
>      try {
> 	_moduleCtor();
> 	_moduleUnitTests();
>
> 	result = doit();
>      }
>
>      catch (Object o) {
> 	MessageBoxA(null, (char *)o.toString(), "Error",
> 		    MB_OK | MB_ICONEXCLAMATION);
> 	result = 0;
>      }
>
>      gc_term();
>      return result;
> }
> ----------
>
> I've been using a slightly different version, which works as far as I
> can see:
>
> ----------
> import std.c.windows.windows;
>
> extern (C) void gc_init();
> extern (C) void gc_term();
> extern (C) void _minit();
> extern (C) void _moduleCtor();
> extern (C) void _moduleUnitTests();
>
> extern (Windows)
> int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
> 		LPSTR lpCmdLine, int nCmdShow) {
>      gc_init();
>      _minit();
>
>      try {
> 	_moduleCtor();
> 	_moduleUnitTests();
>
> 	return doit();
>      }
>
>      catch (Object o) {
> 	MessageBoxA(null, (char *)o.toString(), "Error",
> 		    MB_OK | MB_ICONEXCLAMATION);
> 	return 0;
>      }
>
>      finally {
> 	gc_term();
>      }
> }
> ----------
>
> But is there any possible reason not to use this form?  If not, I'm
> inclined to suggest putting this one in the documentation in place of
> the other one, as it seems neater and more logical.
>
> Stewart.
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
February 27, 2004
SpookyET wrote:
> In Visual C++, you can set the entry point to main intead of WinMain.

I completely fail to understand how this correlates to D programming. It's like saying 'in PHP <? demarks the entry point'...

And I had such high hopes for that Dvorak keyboard of yours.

Cheers,
Sigbjørn Lund Olsen
February 27, 2004
SpookyET wrote:

> In Visual C++, you can set the entry point to main intead of WinMain.
<snip top of upside-down reply>

What has C++ to do with the price of troll-meat?

Stewart.

-- 
My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment.  Please keep replies on the 'group where everyone may benefit.
February 27, 2004
Stewart Gordon wrote:
> SpookyET wrote:
> 
>> In Visual C++, you can set the entry point to main intead of WinMain.
> 
> <snip top of upside-down reply>
> 
> What has C++ to do with the price of troll-meat?
> 
> Stewart.
> 

now I'm going to troll a bit ;-)

maybe his comments aren't always to the point but he's not the one being negative towards other people.
The first one that never makes a remark that's not 100% spot on, may throw the first stone. (Where did I here that?)

If the D community wants to expand it'll take a lot more of your nerves the coming years and my advice is that your should give up now.

bye guys,

roel
February 27, 2004
SpookyET wrote:

> In Visual C++, you can set the entry point to main intead of WinMain.
> 

WinMain is stupid to begin with, but I don't think D is the place to try and fix it.  (much like trying to fix win32)

 -- andy
February 27, 2004
In article <opr31aoudf1s9n15@saturn>, SpookyET says...
>
>In Visual C++, you can set the entry point to main intead of WinMain.
>

You can do that in D too.

-------------------
Carlos Santander B.
February 27, 2004
In article <c1nhml$1of2$1@digitaldaemon.com>, Stewart Gordon says...
>
>The website gives this form for WinMain:
>
>----------
>import std.c.windows.windows;
>
>extern (C) void gc_init();
>extern (C) void gc_term();
>extern (C) void _minit();
>extern (C) void _moduleCtor();
>extern (C) void _moduleUnitTests();
>
>extern (Windows)
>int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
>		LPSTR lpCmdLine, int nCmdShow) {
>     int result;
>
>     gc_init();
>     _minit();
>
>     try {
>	_moduleCtor();
>	_moduleUnitTests();
>
>	result = doit();
>     }
>
>     catch (Object o) {
>	MessageBoxA(null, (char *)o.toString(), "Error",
>		    MB_OK | MB_ICONEXCLAMATION);
>	result = 0;
>     }
>
>     gc_term();
>     return result;
>}
>----------
>
>I've been using a slightly different version, which works as far as I can see:
>
>----------
>import std.c.windows.windows;
>
>extern (C) void gc_init();
>extern (C) void gc_term();
>extern (C) void _minit();
>extern (C) void _moduleCtor();
>extern (C) void _moduleUnitTests();
>
>extern (Windows)
>int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
>		LPSTR lpCmdLine, int nCmdShow) {
>     gc_init();
>     _minit();
>
>     try {
>	_moduleCtor();
>	_moduleUnitTests();
>
>	return doit();
>     }
>
>     catch (Object o) {
>	MessageBoxA(null, (char *)o.toString(), "Error",
>		    MB_OK | MB_ICONEXCLAMATION);
>	return 0;
>     }
>
>     finally {
>	gc_term();
>     }
>}
>----------
>
>But is there any possible reason not to use this form?  If not, I'm inclined to suggest putting this one in the documentation in place of the other one, as it seems neater and more logical.
>
>Stewart.
>
>-- 
>My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment.  Please keep replies on the 'group where everyone may benefit.

I might be wrong, but in your version, the program returns before the 'finally', so maybe gc_term is not called. Can't test it now, though.

-------------------
Carlos Santander B.
February 28, 2004
"Carlos Santander B." <Carlos_member@pathlink.com> wrote in message news:c1ofnp$ck1$1@digitaldaemon.com...
> In article <c1nhml$1of2$1@digitaldaemon.com>, Stewart Gordon says...
> >
> >The website gives this form for WinMain:
> >
> >----------
> >import std.c.windows.windows;
> >
> >extern (C) void gc_init();
> >extern (C) void gc_term();
> >extern (C) void _minit();
> >extern (C) void _moduleCtor();
> >extern (C) void _moduleUnitTests();
> >
> >extern (Windows)
> >int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
> > LPSTR lpCmdLine, int nCmdShow) {
> >     int result;
> >
> >     gc_init();
> >     _minit();
> >
> >     try {
> > _moduleCtor();
> > _moduleUnitTests();
> >
> > result = doit();
> >     }
> >
> >     catch (Object o) {
> > MessageBoxA(null, (char *)o.toString(), "Error",
> >     MB_OK | MB_ICONEXCLAMATION);
> > result = 0;
> >     }
> >
> >     gc_term();
> >     return result;
> >}
> >----------
> >
> >I've been using a slightly different version, which works as far as I can see:
> >
> >----------
> >import std.c.windows.windows;
> >
> >extern (C) void gc_init();
> >extern (C) void gc_term();
> >extern (C) void _minit();
> >extern (C) void _moduleCtor();
> >extern (C) void _moduleUnitTests();
> >
> >extern (Windows)
> >int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
> > LPSTR lpCmdLine, int nCmdShow) {
> >     gc_init();
> >     _minit();
> >
> >     try {
> > _moduleCtor();
> > _moduleUnitTests();
> >
> > return doit();
> >     }
> >
> >     catch (Object o) {
> > MessageBoxA(null, (char *)o.toString(), "Error",
> >     MB_OK | MB_ICONEXCLAMATION);
> > return 0;
> >     }
> >
> >     finally {
> > gc_term();
> >     }
> >}
> >----------
> >
> >But is there any possible reason not to use this form?  If not, I'm inclined to suggest putting this one in the documentation in place of the other one, as it seems neater and more logical.
> >
> >Stewart.
> >
> >-- 
> >My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment.  Please keep replies on the 'group where everyone may benefit.
>
> I might be wrong, but in your version, the program returns before the
'finally',
> so maybe gc_term is not called. Can't test it now, though.

If finally has the same semantics as in Java/.NET this would not work.


February 28, 2004
"Roel Mathys" <roel.mathys@yucom.be> wrote in message news:c1obba$4e1$1@digitaldaemon.com...
> Stewart Gordon wrote:
> > SpookyET wrote:
> >
> >> In Visual C++, you can set the entry point to main intead of WinMain.
> >
> > <snip top of upside-down reply>
> >
> > What has C++ to do with the price of troll-meat?
> >
> > Stewart.
> >
>
> now I'm going to troll a bit ;-)
>
> maybe his comments aren't always to the point but he's not the one being
> negative towards other people.
> The first one that never makes a remark that's not 100% spot on, may
> throw the first stone. (Where did I here that?)

I think you heard that in the Bible, I think it says
"Let he that hath no sin, cast the first stone"

Beleive it or not I remember that from about
30 years ago, when I went to Sunday school.

Not that I follow this rule, unfortunately :o))

Phill.


« First   ‹ Prev
1 2 3 4 5