
April 19th, 2003, 11:50 AM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
My immediate response is to tell you to read WinProlog's documentation for that. I say that, because such capabilities rely more on the implementation than on general language features. For example, my only prolog experience was with Borland's Turbo Prolog; Turbo Prolog could call C functions, but a C program could not call Turbo Prolog.
I just did a quick Google on WinProlog and found this statement at http://www-lp.doc.ic.ac.uk/UserPage...l/lpa/lpa1.html :
Quote:
DLL Interface. Allows Prolog to call, or be called by, programs written in C, Pascal, etc. Synchronous and asynchronous message passing is supported. |
So that tells me that it can be done. That's half the battle.
At the company's website, http://www.lpa.co.uk/win_det.htm , I read:
Quote:
Direct Windows API Interface
As well as providing high-level access to around 100 Windows API (Application Programming Interface) functions, not to mention numerous subfunctions, WIN-PROLOG includes a special interface which allows your programs to call virtually any C function directly, whether defined in the Windows API or in a DLL or other module. The winapi/3 predicate allows any function, defined in any 32-bit module, to be called with any number of parameters. The parameters may be integers, string pointers, or arbitrary structures, and facilities exist for defining named "memory files". All memory allocation and stack frame creation is carried out automatically, so your only job as a programmer is to provide the relevant data and call the function.
The Windows API function means that your programs are no longer "limited" to using the 100-plus API functions built into WIN-PROLOG by LPA, but can add additional functions yourself as and when you need them. It also provides a direct way to invoke code in DLLs, without having to write parameter-translating ("glue") code in C/C++. |
So somewhere there has to be an API defined for that DLL and the only place I can think of would be in the documentation somewhere.
Some of the messages in the comp.lang.prolog newsgroup mention WinProlog, so that might be a place to post your question as well. I usually access the newsgroups through Google. Google also has a search engine for the newsgroups, so you can search through past messages.
Last edited by dwise1_aol : April 19th, 2003 at 11:53 AM.
|