[Oberon] DLL / COM / ActiveX with Plugin Oberon (Win XP)

Patrick.Hunziker at unibas.ch Patrick.Hunziker at unibas.ch
Thu Apr 10 10:07:47 CEST 2003


I have used it - it works.
The key points for .exe are:
- Re-Use a *.Link file from the Oberon distribution ( separate *.Link files 
for .exe or .dll).
- If you need a statically linked standalone application -> add those Oberon 
Modules that are needed in your application and that are otherwise dynamically 
loaded. To find all the needed modules, execute your program in the Oberon 
environment and the execute System.ShowModules.
- Add the module chain of your planned executable to your *.Link file, 
observing load order.
- Remove those Modules from the *.Link file that are not needed. Here I have 
found that the minimum core modules given in Emil Zellers internet page do not 
suffice in all cases => try reducing files stepwise starting low in the list.
- Important: change "Version" section of link file first to a new program 
designation - otherwise you get a mess in the Windows Registry for your 
existing Oberon.exe.
- Modify the *.reg File (filename & content) to fit your needs.
- Register the .exe by clicking on the new reg file
- start your application.

In the case of *.dll files:
If you want to call functions/procedures from the outside (e.g., to C 
programs), the key problem is the Alignement of passed parameters. 
Unfortunately, I have not found an easy way to see the actual byte arrangement 
of procedure header variables with the more recent versions of plugin Oberon 
(somebody else might know).
There is a way around that problem, though: If you pack all your passed 
parameters into a record, its field occupy clearly defined/predictable address 
positions. 
This way, it worked fine for me.
The correspondence of datatypes in Oberon with datatypes in C are given in Emil 
Zellers page given below.
Make shure, when writing a program in another language like C that calls your 
*.dll that you use the right compiler settings that lead to predictable sizes 
of "C Int", Sets, Booleans etc. Try to start with minimally complicated 
headers. Some other possible questions are lurking, e.g. the 2 vs 4 vs 8 Byte 
alignement used in different foreign language compilers.

If somebody knows a simple tool to byte map interfaces of procedures in the 
latest version of Plugin Oberon, especially those produced by the PELinker, let 
us know.

ActiveX also worked OK according to Emil Zellers example, although is is 
sometime back I did the experiments.

Hopefully, the upcoming "Active PlugIn Oberon" will retain those useful 
features.

Message: 7
Date: Wed, 9 Apr 2003 08:59:45 +0200
From: "Treutwein Bernhard" <Bernhard.Treutwein at Verwaltung.Uni-Muenchen.DE>
To: <oberon at inf.ethz.ch>
Subject: [Oberon] DLL / COM / ActiveX with Plugin Oberon (Win XP)
Reply-To: oberon at inf.ethz.ch


Apparently PluginOberon for Windows NT allows the creation of
DLLs and supports COM / ActiveX (see Emil Zeller's page about
linking EXEs and DLLs in Plugin-Oberon 
http://www.cs.inf.ethz.ch/~zeller/plugins.html#PELinker
and let Watson browse for COM ).

Does some brave soul have experiences with it and is willing 
to share these experiences ?

--
        Bernhard Treutwein, IuK, Ref. III A 3
        Bernhard.Treutwein (at) verwaltung uni-muenchen de
        BdT (at) wildwein de


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the Oberon mailing list