On Saturday, 5 September 2015 at 01:43:43 UTC, Prudence wrote:
Any ideas?
See how vibe does it.
On Saturday 05 September 2015 07:52, anonymous wrote:
> This doesn't work because delegates and static initialization don't go
> together. You can use a static constructor:
>
>
> const Application MyApp;
> static this()
> {
> Application.New({import std.stdio; std.stdio.writeln("MY APP
On Saturday 05 September 2015 03:43, Prudence wrote:
> Standard and Win32 apps are so old school!
>
> I'd like to hide WinMain by wrapping it in an application
> class(more or less).
>
> Essentially I have an Application class
>
> class Application
> {
> public static Application New(void
On Saturday, 5 September 2015 at 02:29:05 UTC, Prudence wrote:
If I use functions instead of delegates it works.
I suppose the problem then is that the delegate can't create a
fat pointer when used in a static context. (i.e., why the
functions work)
The question is, then, Can I construct a
Standard and Win32 apps are so old school!
I'd like to hide WinMain by wrapping it in an application
class(more or less).
Essentially I have an Application class
class Application
{
public static Application New(void delegate() entry)
{
}
}
Another module
extern (Windows)
On Saturday, 5 September 2015 at 01:49:22 UTC, Adam D. Ruppe
wrote:
On Saturday, 5 September 2015 at 01:43:43 UTC, Prudence wrote:
extern (Windows) int WinMain(...)
If you use WinMain in D, you'll also have to initialize the D
runtime yourself, which will call static constructors and such.
If I use functions instead of delegates it works.
I suppose the problem then is that the delegate can't create a
fat pointer when used in a static context. (i.e., why the
functions work)
The question is, then, Can I construct a delegate manually and
supply my own context pointer?
e.g.,
On Saturday, 5 September 2015 at 01:43:43 UTC, Prudence wrote:
extern (Windows) int WinMain(...)
If you use WinMain in D, you'll also have to initialize the D
runtime yourself, which will call static constructors and such.
You'd be better off just using a regular main() function, then