Biggest problems w/ D

Gilles G. schaouette at free.fr
Fri Aug 10 05:35:47 PDT 2007


Paul Findlay Wrote:

> > I would just like to put the name of the DLL in the variable name. What I
> > would do in C is something like:
> > Â  Â  Â extern(Windows) void GetName(char* name)
> > Â  Â  Â {
> > Â  Â  Â  Â  Â  name = "The DLL name";
> > Â  Â  Â }
> Not tested/compiled, but would something like
> 
> const char[] DLL_NAME = "The DLL name";
> extern(Windows) void GetName(char* name)
> {
> Â  Â  name = DLL_NAME.ptr;
> }
> 
> work?
Unfortunately, no.
I tried:
const char[15] DLL_NAME="The DLL name";
extern(Windows) void GetName(char* name)
{
     name = DLL_NAME.ptr;
}



More information about the Digitalmars-d mailing list