A DLL to modify a variable?

Daniel Keep daniel.keep.lists at gmail.com
Tue Jun 26 05:00:28 PDT 2007



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