A DLL to modify a variable?

Gilles G. schaouette at free.fr
Tue Jun 26 05:28:15 PDT 2007


Thanks a lot, I would never find this one.

--
Gilles

Daniel Keep Wrote:

> 
> 
> Gilles G. wrote:
> > Hello,
> > maybe I am obviously missing something, but it seems that my dll doesn't modify the value of the variables.
> > It looks like this:
> > === File from the DLL (with the corresponding def file)
> > extern(Windows) void modifyThis(int* val){*val=0;}
> > 
> > === call to the DLL function in the test program
> > alias void function(int*) modifyThis_t;
> 
> I *could* be wrong, but this looks to be incorrect.  It should be (if I
> remember correctly):
> 
> extern(Windows)
> {
>     alias void function(int*) modifyThis_t;
> }
> 
> Otherwise, the function type will use the D calling convention, which is
> probably incompatible with stdcall.
> 
> Give it a shot, anyway.
> 
> 	-- Daniel



More information about the Digitalmars-d-learn mailing list