Example Attached

Heinz malagana15 at yahoo.es
Fri Feb 13 06:11:51 PST 2009


torhu Wrote:

> On 10.02.2009 19:51, Heinz wrote:
> > Heinz Wrote:
> >
> > I attached a rar file with the sources just to see what i'm talking about. The example is from the DMD site. Included is the extern D (ok) and the extern C (fails). To compile open "compile.bat" and to run the programs use "run.bat".
> 
> Try this:
> alias extern (C) void function(void*) MyDLL_Initialize_fp;
> alias extern (C) void function() MyDLL_Terminate_fp;
> alias extern (C) MyClass function() getMyClass_fp;

Haha! cool man, thanx, it works.
I never though it could be the type but adding extern(C), the program treats variables as C function pointers. I had no idea at all that i can create extern(C) variables to be trated as C type. I learned something new today!
Thanks again.



More information about the Digitalmars-d-learn mailing list