DLL, export bool dfunc(char[] s, extern (Windows) bool function() cb)

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Jan 15 11:37:04 PST 2008


"Bjoern" <nanali at nospam-wanadoo.fr> wrote in message 
news:fmiien$14cf$1 at digitalmars.com...

>
> export bool dfunc(char[] s, extern (Windows) char[] function() cb)
>
> I think at least my intention is clear , so I hope somebody is willing to 
> show me how to implement such a DLL function.
>

I'm guessing that 4GL expects DLL functions to use either C or Windows 
calling conventions.  Secondly AFAIK there's no way to indicate the calling 
convention of a function pointer inline; it has to be done as an 
alias/typedef and then used.

alias extern(Windows) char[] function() MyFuncType;

// Don't know if it's extern(C) or extern(Windows)
extern(Windows) export bool dfunc(char[] s, MyFuncType cb)
{
    ...
} 





More information about the Digitalmars-d mailing list