Hi,
The VisualAge Cobol program used OS/2 APIs to load DLLs and unload them after use. Unfortunately the VA Cobol on the Windows platform does not have similar DLLs in the package. I am including an extract from a program to give you an idea of how it worked in the OS/2 environment. Does anyone have any idea how this "loadComponent" could be replaced by a Windows API call ?
Load-DivComp.
* Inv2P-P (Pointer) is of no consequence here.
SET Inv2P-P TO ADDRESS OF Inv2P-Parent
SET InvJLAnm-P TO ADDRESS OF JLAnmDef
*
MOVE 8 TO ParentComponent-Length
* Name of 'ParentComponent-String' and Length
* Attention !! Name INVPERS1 should not be changed,
* ---------- as it is referred to in the called Component for using 'connect to Database'.
MOVE ApplName TO ParentComponent-String
Inv2P-Parent
MOVE 18 TO Inv2P-Length
CALL "loadComponent" USING ComponentLoad,
Inv2P-POINT,
VDE-RC
IF NOT VDE-RC-OK
MOVE "InvPers1 - loadComponent xxxxxxxx "
TO VDECHK-Anw
MOVE ChildComponent-String(1:8)
TO VDECHK-Anw(26:8)
Perform LoadVDE-CHK
END-IF.
* ---------------------------------------------------------------
* Load Component "VDE-CHK " to show VDE-RC and -reason
*
* ---------------------------------------------------------------
* only VDE-RC from Messages / load Components / Terminate
* were included when the HANDLE-business was being tested
*
* ----------------------------------------------------------------
LoadVDE-CHK.
SET VDECHK-P TO ADDRESS OF VDE-CDef
MOVE VDE-RC TO VDECHK-RC
MOVE 8 TO ParentComponent-Length
* Name of 'ParentComponent-String' and Length
MOVE ApplName TO ParentComponent-String
MOVE ApplName TO VDECHK-Parent
MOVE 7 TO ChildComponent-Length
MOVE "VDE-CHK" TO ChildComponent-String
MOVE 14 TO VDECHK-Length
CALL "loadComponent" USING ComponentLoad,
VDECHK-POINT
VDE-RC.
* here no 'NOT VDE-RC-OK' - query, as that would start a L o o p.
The VisualAge Cobol program used OS/2 APIs to load DLLs and unload them after use. Unfortunately the VA Cobol on the Windows platform does not have similar DLLs in the package. I am including an extract from a program to give you an idea of how it worked in the OS/2 environment. Does anyone have any idea how this "loadComponent" could be replaced by a Windows API call ?
Load-DivComp.
* Inv2P-P (Pointer) is of no consequence here.
SET Inv2P-P TO ADDRESS OF Inv2P-Parent
SET InvJLAnm-P TO ADDRESS OF JLAnmDef
*
MOVE 8 TO ParentComponent-Length
* Name of 'ParentComponent-String' and Length
* Attention !! Name INVPERS1 should not be changed,
* ---------- as it is referred to in the called Component for using 'connect to Database'.
MOVE ApplName TO ParentComponent-String
Inv2P-Parent
MOVE 18 TO Inv2P-Length
CALL "loadComponent" USING ComponentLoad,
Inv2P-POINT,
VDE-RC
IF NOT VDE-RC-OK
MOVE "InvPers1 - loadComponent xxxxxxxx "
TO VDECHK-Anw
MOVE ChildComponent-String(1:8)
TO VDECHK-Anw(26:8)
Perform LoadVDE-CHK
END-IF.
* ---------------------------------------------------------------
* Load Component "VDE-CHK " to show VDE-RC and -reason
*
* ---------------------------------------------------------------
* only VDE-RC from Messages / load Components / Terminate
* were included when the HANDLE-business was being tested
*
* ----------------------------------------------------------------
LoadVDE-CHK.
SET VDECHK-P TO ADDRESS OF VDE-CDef
MOVE VDE-RC TO VDECHK-RC
MOVE 8 TO ParentComponent-Length
* Name of 'ParentComponent-String' and Length
MOVE ApplName TO ParentComponent-String
MOVE ApplName TO VDECHK-Parent
MOVE 7 TO ChildComponent-Length
MOVE "VDE-CHK" TO ChildComponent-String
MOVE 14 TO VDECHK-Length
CALL "loadComponent" USING ComponentLoad,
VDECHK-POINT
VDE-RC.
* here no 'NOT VDE-RC-OK' - query, as that would start a L o o p.