Subject: load_foreign_library

From: Aparecido Valdemir de Freitas <[email-masked]>
Date: Mon, 30 Aug 1999 13:59:37 -0300

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: [email-masked]