----boundary-LibPST-iamunique-1009134479_-_-
Content-type: text/plain
Have a look to Dev/Docu/ComInterfaceGen.odc to automatically generate an
interface for a .dll from a type library. Type libraries are either linked
into the .dll or distributed as a separate file. Some .dlls have no type
libraries; hence there it won't work.
.sym files can not be edited. You will need to create an .odc file.
e.g.:
********************************
MODULE ExWinApi ["KERNEL32"];
IMPORT W := WinApi;
PROCEDURE RtlZeroMemory* (Destination: W.PtrVoid; Length: INTEGER);
END ExWinApi.
********************************
There are 2 ways to load a library, one as described in the Blackbox
documentation (above) and the other under program control using the Windows
API. The later may appear more complicate, but allows checking for errors
while loading dlls. (No .sym files required for number 2. All function need
to be declared as procedure variables.)
********************************
MODULE ExUser32;
IMPORT SYSTEM, WinApi;
CONST
MBOk* = {};
MBIconExclamation* = {4, 5};
VAR
(* read-only export procedure variable*)
MessageBox-: PROCEDURE (hWnd: WinApi.HWND; lpText, lpCaption:
WinApi.PtrSTR; uType: SET): INTEGER;
PROCEDURE Test*;
VAR
dummy: INTEGER;
BEGIN
dummy := MessageBox(0, "Hello World", "Hello World Caption", MBOk +
MBIconExclamation)
END Test;
(* Wrapper for getProcAddress. *)
PROCEDURE GetProcAddress*(hModule: WinApi.HMODULE; lpProcName:
WinApi.PtrSTR; VAR adr: WinApi.FARPROC);
BEGIN
adr := WinApi.GetProcAddress(hModule, lpProcName)
END GetProcAddress;
PROCEDURE InitAPI();
VAR mod: WinApi.HMODULE;
BEGIN
mod := WinApi.LoadLibrary("User32.DLL");
GetProcAddress(mod, "MessageBoxA", SYSTEM.VAL(WinApi.FARPROC,
MessageBox));
END InitAPI;
BEGIN
InitAPI()
END ExUser32.
ExUser32.Test
********************************
The above example was ported from Oberon System 3.
Cheers, Philipp
http://www.elec.canterbury.ac.nz/PublicArea/Staff/hof/p50-win/
-----Original Message-----
From: A Thomas [mailto:ant{([at]})nowhere.xy
Sent: Saturday, 30 July 2005 1:44 a.m.
To: blackbox{([at]})nowhere.xy
Subject: [BlackBox] - [BlackBox] and dlls
Hei BlackBox world,
When you want to use a dll in a BlackBox application an interface
module for the dll must be write. In the BB documentation it says the name
of the dll without any path and without the .dll extension must be placed
inside square brackets after the name of the module.
Looking at the BlackBox source code some of the interface modules have a
.dll after the name of the dll. Why is this and does it matter?
Also there are sym files for some dll that are in the windows/system32
directory but no interface modules for these dll. Can I make the missing
interface modules by editing the corresponding sym file and compiling?
Has anyone experience of running BlackBox with Wine? There seem to be linux
so equivalents of the Windows dll available. Maybe BlackBox would work with
these on linux.
Regards
Andrew
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1009134479_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhhdmUgYSBsb29rIHRvIERldi9Eb2N1L0NvbUlu
dGVyZmFjZUdlbi5vZGMgdG8gYXV0b21hdGljYWxseSBnZW5lcmF0ZSBhblxwYXINCmludGVyZmFj
ZSBmb3IgYSAuZGxsIGZyb20gYSB0eXBlIGxpYnJhcnkuIFR5cGUgbGlicmFyaWVzIGFyZSBlaXRo
ZXIgbGlua2VkXHBhcg0KaW50byB0aGUgLmRsbCBvciBkaXN0cmlidXRlZCBhcyBhIHNlcGFyYXR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