Accessing exported variables in DLL with dlsym().
Andrej Borsenkow
Andrej.Borsenkow@mow.siemens.ru
Fri Jul 7 00:57:00 GMT 2000
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
More information about the Cygwin
mailing list