Export values (enum, int, char[]...) for DLL

Ary Borenszweig ary at esperanto.org.ar
Wed May 5 10:41:25 PDT 2010


Nrgyzer wrote:
> Hello everybody,
> 
> I'm trying to create a (very) simple DLL by using D. Now I want export values - is there any way do this... for example:
> 
> Example:
> 
> mydll.d:
> export int i;
> 
> mydll2.d:
> export int i = 99;
> 
> dll.d:
> // Copied from http://www.digitalmars.com/d/2.0/dll.html
> 
> test.d:
> import std.stdio;
> import mydll;
> 
> void main() {
>    writefln(mydll.i);
> }
> 
> -> The problem is (same problem for float, enum... , that I always get 0 by calling mydll.i instead of 99.
> I hope anyone can help me, please :)
> 
> Thanks for help in advance :)

I don't know much about dlls, but aren't you accessing mydll.i, which is 
0, instead of mydll2.i, which is 99?


More information about the Digitalmars-d-learn mailing list