delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/07/04:06:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer goliath.siemens.de)
From: "Andrej Borsenkow" <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
To: "Heribert Dahms" <heribert_dahms AT icon-gmbh DOT de>,
<cygwin AT sourceware DOT cygnus DOT com>
Subject: RE: Accessing exported variables in DLL with dlsym().
Date: Fri, 7 Jul 2000 11:56:58 +0400
Message-ID: <000201bfe7e8$eccc8ac0$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
In-Reply-To: <99B82AA9708ED0119B55006097125A00363ED0@ifk63.mach.uni-karlsruhe.de>

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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019