Hi
i need to call a C Dynamic Library .. passing it a string and the libary returns another string
in C Language is enough to add to caller the entry point of called
extern char* DLL_Licence(char* exe);
the called executable name is
lic.so ... (lic.so source has not a main)
then i tell the linker to reference lic.so
How to proceed is the caller is a Cobol pgm ?
is the procedure the same of calling a dynamic cobol library ?
How can i pass the entry point ?
Thanks is advance for your support
MAurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The approach is similar. In any case you pass something by reference and use RETURNING ADDRESS OF LINKAGE-DATA-ITEM or a pointer, then manually setting a var's address. Like in C you need to have C pass either a pointer to a static address or allocate and therefore later deallocate the address.
You either use CALL STATIC funcname and then pass lic.so as "input" to cobc or use COB_PRE_LOAD to use dynamic linking with different name so/func.
Hi
i need to call a C Dynamic Library .. passing it a string and the libary returns another string
in C Language is enough to add to caller the entry point of called
the called executable name is
lic.so ... (lic.so source has not a main)
then i tell the linker to reference lic.so
How to proceed is the caller is a Cobol pgm ?
is the procedure the same of calling a dynamic cobol library ?
How can i pass the entry point ?
Thanks is advance for your support
MAurizio
The approach is similar. In any case you pass something by reference and use RETURNING ADDRESS OF LINKAGE-DATA-ITEM or a pointer, then manually setting a var's address. Like in C you need to have C pass either a pointer to a static address or allocate and therefore later deallocate the address.
You either use CALL STATIC funcname and then pass lic.so as "input" to cobc or use COB_PRE_LOAD to use dynamic linking with different name so/func.
Hi Simon
I was able to work succesfully with both CALL STATIC and COB_PRE_LOAD
Thanks for your support
Maurizio