Richard,
In message <vm51rhehrv8dee@corp.supernews.com>, Richard
<rdmerrio@amaonline.com> writes
>Question 1
>I am new to poplog and I do not have much C experience. I am trying to
>figure out how to call the exported functions from the poplog DLL from
>Delphi but I cannot figure out the interface and my reading of the source
>code has left me less than enlightened (due to my lack of C experience). Can
>anyone offer some tips?
>
To use the poplog DLL via the OLE(2)/(D)COM(+) collection of names for a
technology, you would need to have a type library to describe the
interface supported by the DLL.
Some preamble. The DLL is linked together from the poplog.res resource
file and the "src", "vedsrc" and "winsrc" wlb libraries. The wlb
libraries are built by using pgcomp(.bat) on the various source
directories. The pgcomp routine uses the statically linked version of
Poplog (corepop) defined by the code in %usepop%\pop\extern.
The system is built with an installation of Microsoft C++ and Microsoft
Assembler.
The build process generates a command such as the following to make the
DLL. (Note that <sandbox path> is the path to your sandbox directory
containing the code exported from the CVS).
corepop +<sandbox path>\poplog\pop\pop\poplink -p -e
$-Sys$-Poplog_Main -s ( $- $-lisp ) -ident 0 -o poplog.dll -lf (
/NODEFAULTLIB /INCREM
ENTAL:NO /PDB:NONE /RELEASE /NOLOGO -entry:_DllMainCRTStartup@12 -dll
-base:0x800000 -def:..\extern\src\poplog.def ) -lo ( poplog.res )
..\obj\winsrc.wlb -ex
( ) ..\obj\vedsrc.wlb -ex ( ) ..\obj\src.wlb -ex ( )
Normally, you could adapt this process to generate a suitable list of
exports automatically. Poplog has no mechanism I know of to label
functions to export via a type library, and labelling the C functions in
the extern code won't help because they only feature in the statically
linked corepop.exe.
So, you will need to create a suitable type library by hand. Having said
this, there is a poplog.def (module definition) file in
%usepop%\pop\extern\src that conveniently tells you what functions are
exported. You should be able to use this directly to import the
functions by name using Delphi's "external" directive. Of course, if you
produce an external module full of external Delphi declarations of
Poplog functions, you will produce something that is only of use to
Delphi programmers. If you produce a type library, you can donate it to
the Poplog community (Windows faction), who can use it to import the
functions into a range of other languages.
>Thanks
>
>
>
Regards,
--
Jeff Best
|