Help: running a method from the importing file's method "space"

Era Scarecrow rtcvb32 at yahoo.com
Mon Apr 30 11:50:23 PDT 2012


On Monday, 30 April 2012 at 18:30:29 UTC, Rowan wrote:

> --------------
> File: MyLib.d:
> --------------
>
> module MyLib;
>
> import core.runtime;
> import core.sys.windows.windows;
> //import std.string;
>
>
> So if I want to make any file (in this case "test.d", which can 
> just import MyLib after I have -lib'd it and use the custom 
> "entry point" -> "progMain" after "MyLib" has gotten everything 
> it needs from the WinMain entry point, so that the programmer 
> (me) can now just import MyLib and start typing their code in 
> progMain instead of the usual main() without having to alter 
> the source of MyLib. Basically I want MyLib to be able to call 
> test's "progMain()", as when I try I get some error along the 
> lines of progMain() not existing. I hope someone understands 
> me, if you do and have an answer could you give me a step by 
> step way of doing this?

  Add 'import test;' to your MyLib module.



More information about the Digitalmars-d-learn mailing list