What is wrong with this boilerplate mixin?

Chris Nicholson-Sauls ibisbasenji at gmail.com
Mon Oct 23 17:08:14 PDT 2006


AF wrote:
>  Thank you very much. But, at the moment, I would like to stay in
> vanilla win32api framework.
>  Second, I do not really need an workaround: it is the intended
> behaviour of dmd to mangle functions that way, or it is improper
> use of syntax (i.e. my fault)?.
>  I simply find ugly to bear all that gc boilerplate code with any
> application when things could be simpler. Any reason why not all gc
> code should be directly integrated in phobos (or dmd) WinMain
> function? (actually, why have WinMain() at all and not just main()?)
>  As for delegates, could you (or someone else) be so kind to
> provide my an example based on the code and ideea I submitted?
> 
>  Thanks in advance.
> 
>  AF

Actually, you /can/ use just main(), which is my personal preferance.  Just a couple of 
things to consider.  First, in order to ensure you get an exe which doesn't pop up a 
console window, pass '-L/exet:nt/su:windows:4.0' to the compiler.  (Or whatever would be 
most appropriate).  Second, to get your hInstance you will need to call 
GetModuleHandle(NULL) and store its return.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d-learn mailing list