Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with DLLs

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,312
US
I'm trying to understand what I need to do with Fujitsu COBOL 3.0 in calling external DLLs (or linking in LIB files). It assumes a _ in front of all the procedure names I notice and it's not finding that in my DLLs. Can anyone give me a quick rundown on what I need to do to both create DLLs and call DLLs from COBOL or point me to a good reference? I can't find anything good that explains it with a good example of the syntax.
 
I haven't tried to create DLLs, but can you show (some code) how you are "calling" the DLLs?

Also, you can use the SPECIAL-NAMES Paragraph to resolve naming conventions problems.


__________________________________________
Try forum1391 for lively discussions
 
That's the point. I don't find any documentation relating to the language elements Fujitsu supports within the compiler, and I've tried about all I can think of. I don't have any code to show either how to create a DLL or call one through Fujitsu COBOL 3.0.
 
Don't know if V3 works like this, but you try it.

To add a ".lib" to your project so that you can use other DLL's.
Within project manager, select your executable/dll and then menu "edit->create folder->Library files".

Then select this new folder and select "edit->add file" to add your ".lib" files.


To create a ".dll".

Select your project, and then "edit->add file", and enter your new file as a "xxx.dll".

When you build your project it will link into a ".dll".

If you with to do this manualy the following is a minor demo project I have that creates both a .exe and a .dll, and where the .exe uses the .dll.

Code:
.SUFFIXES:

COBOL_PATH = C:\fsc
PROJECT_PATH = C:\myproject
OBJECT_PATH = 
LINK_DEBUG_OPTION = /DEBUG /DEBUGTYPE:COFF


ALL : "testeio.EXE" "filetemplate.dll" 

REBUILD : CLEAN ALL
CLEAN :
	DEL "testeio.EXE" 
	DEL "testeio.OBJ" 
	DEL "filetemplate.dll" 
	DEL "filetemplate.LIB" 
	DEL "template.OBJ" 


"testeio.OBJ" : "testeio.cbl" "FILETEMPLATE.CBI"
	COBOL32.EXE -i"FILETEMPLATE.CBI" -M "testeio.cbl"

"testeio.EXE" : "testeio.OBJ" "filetemplate.lib" 
	"$(COBOL_PATH)\LINK.EXE" $(LINK_DEBUG_OPTION) \
	/OUT:"testeio.EXE" \
	@"FILETEMPLATE.001" 


"template.OBJ" : "template.cbl" "FILETEMPLATE.CBI"
	COBOL32.EXE -i"FILETEMPLATE.CBI" -NM "template.cbl"


"filetemplate.dll" : "template.OBJ"
	"$(COBOL_PATH)\LINK.EXE" $(LINK_DEBUG_OPTION) \
	/ENTRY:COBDMAIN /DLL \
	/OUT:"filetemplate.dll" \
	@"FILETEMPLATE.002" 

"filetemplate.LIB" : "template.OBJ"
	"$(COBOL_PATH)\LINK.EXE" $(LINK_DEBUG_OPTION) \
	/ENTRY:COBDMAIN /DLL \
	/OUT:"filetemplate.dll" \
	@"FILETEMPLATE.002" 

the @"FILETEMPLATE...." files are generated by project manager itself and don't contain any specific compiler option but just some extra libraries to link the objects with.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top