From afreitas@imes.com.br  Mon Aug 30 18:58:59 1999
Received: from imes.com.br ([200.245.82.129])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id SAA13714
	for <prolog@swi.psy.uva.nl>; Mon, 30 Aug 1999 18:58:56 +0200 (MET DST)
Received: from l0w9f8 (pppremoto16 [200.245.82.112]) by imes.com.br (8.7.1/8.7.1) with ESMTP id OAA05057; Mon, 30 Aug 1999 14:00:54 -0300 (EST)
Message-ID: <37CAB879.2D1DC11D@imes.com.br>
Date: Mon, 30 Aug 1999 13:59:37 -0300
From: Aparecido Valdemir de Freitas <afreitas@imes.com.br>
Reply-To: afreitas@imes.com.br
X-Mailer: Mozilla 4.01 [en] (Win95; I)
MIME-Version: 1.0
To: "prolog@swi.psy.uva.nl" <prolog@swi.psy.uva.nl>
CC: Aparecido Freitas <afreitas@imes.com.br>
Subject: load_foreign_library
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I wrote an DLL based on example included at directory src\win32\foreign.

This interface has a function called say_hello, and the procedure is
normally been executed.

I followed the instructions at the source.
a. Load the DLL:  ?- load_foreign_library(dlltest).
      yes (OK!)
b. say_hello('This is a test of DLL interface').
      yes (OK! The system display the message box)

This example is OKX!

But, I have a little problem!

I wrote an source .pl called teste1.pl,  with the instructions.
    load_foreign_library(dlltest).
    disp :- say_hello('*** This is a DLL - test ***').

I put this file on the same directory of ..\pl\bin, and I execute the
commands:

1. plwin
2. ?- consult(teste1).
    teste1 compiled, 0.00 sec, 1,020 bytes.
    yes
3. ?- disp.
    [WARNING: Undefined procedure: say_hello/1]
         Exception: (   8) say_hello('**** DLL test **** ') ?


The load_foreign_library runs correctly on interactive environment, but
when I put this predicate inside a .pl source, the DLL was not loaded.

I imagined, that there is some problem of install or register the
predicate.

Excuse - me! I hope that I have explained  the problem.

Could somebody help me ?

Best Regards!

Aparecido Valdemir de Freitas
e-mail: afreitas@imes.com.br

