From jan@swi.psy.uva.nl  Wed Nov  8 15:19:27 2000
Received: from gollem.swi.psy.uva.nl (gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id PAA19848;
	Wed, 8 Nov 2000 15:19:27 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id PAA31580;
	Wed, 8 Nov 2000 15:18:26 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: Paul Singleton <p.singleton@keele.ac.uk>,
        SWI Prolog <prolog@swi.psy.uva.nl>
Subject: Re: foreign code chicken/egg scenario
Date: Wed, 8 Nov 2000 15:15:50 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <3A094EE8.C7581051@keele.ac.uk>
In-Reply-To: <3A094EE8.C7581051@keele.ac.uk>
MIME-Version: 1.0
Message-Id: <00110815182601.30820@gollem>
Content-Transfer-Encoding: 8bit

On Wed, 08 Nov 2000, Paul Singleton wrote:
>I have built a MYLIB.DLL (compiled from C) which:
>
> * refers to LIBPL.DLL
>
> * exports some foreign functions and an install() to register them
>
> * calls  PL_initialise()
>
> * then asks Prolog to call  load_foreign_library('MYLIB.DLL')
>
>Would it be OK, and better, for MYLIB.DLL to call install() directly?
>
>My approach seems to work, except it resets MYLIB's variables to zero,
>as if it were actually being reloaded (or at least reinitialised).

Sounds like dangerous practice.  If your dll embeds Prolog simply call
the install() function after PL_initialise().

	--- Jan

