This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Accessing exported variables in DLL with dlsym().



Sorry, folks, it was my fault. I went blind :-(((

>
> if you can rebuild the DLL from source, you may do what TCL/TK
> did years ago due to this Win* deficiency: Add simple wrapper
> functions which just return the pointer to one of your variables.
>

> > foo() {
> >     char *bar;
             ^^^^^
nonsense; should be ``char **bar'' and

> >     void *libbar;
> >
> >     libbar = dlopen ("libbar.dll", 0);
> >     bar = dlsym (libbar, "bar");
> >     puts (bar);

of course ``puts (*bar);''

A beg your pardon for this noice.

BTW it looks, like it works even if variable is not declared with
dllexport ...

-andrej


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]