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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MF COBOL calling .DLL

Status
Not open for further replies.

webrabbit

MIS
Jan 31, 2003
1,059
US
I downloaded a forms generater/printer driver (Microfocus 16-bit version). I want to use it with Microfocus COBOL 3.2.46 under DOS/Windows. The package includes a .DLL which does the printer selection and formatting. I am unable to successfully call the .DLL.

I get "Load failure (165) on QPR" (or QPR.DLL, depending on my CALL statement).

Does anyone know what I need to change in my program or environment (SET) variables to get this to work?

I have tried CALL 'QPR', CALL 'QPR.DLL', and CALL 'QPR.DLL '.

I tried SET LIB=.;\COBOL\LIB
 
As best as I can recall you cannot use 16 bit DLL's on 32 bit platforms. Usually MF provided 16 bit & 32 DLL's to get around the problem. Perhaps try and get the 32 bit versions of the DLL's.

Clive
 
16-bit dlls can be used on 32-bit Windows platforms (see
I suspect you have a problem with versioning.

IIRC, the 165 error indicates a load failure on the dll that is most likely caused by inability to satisfy some dll dependency. That could be caused by a missing dll or by a dll that is missing an entry point (i.e. a different version of the dll is present on your machine than what is needed).

In the 32 bit world, you can check on static dependencies with Dependency Walker (a Microsoft Visual Studio component). I'm not sure how to approach it in the 16-bit world.

Regards.

Glenn
 
I think that I would have to get an .OBJ or an .EXE from the site. Does anyone agree with me?
 
How do you execute your COBOL programs?
When you use .EXE & .DLL files you must include the additional DLL's in the link-edit step.

When you run .gnt or .int, or when you want to animate try this:
Code:
01 DLL-gr.
   03 DLL-PTR procedure-pointer.
   03 DLL-TXT value "c:\blablabla\QPR.DLL"
                pic  XXXXXXXXXXXXXXXXXXXX.
in you init:
Code:
set DLL-PTR to entry DLL-TXT.

Then you should be able to call your module.
 
Truusvlugindewind:

Could you show me the format of the CALL statement using this code? In particular, what word/text/variable_name goes right after the CALL verb?
 
That depends on the module...
The sequence of the passed parameters have a direct relationship with the CALL-CONVENTION used in you SPECIAL-NAMES paragraph. Are you familiar with that?
 
Yes, I am familiar with CALL-CONVENTION. That is a separate issue. I need to get past the 165 first.
 
Right, but you did not answer my questions yet. How do you compile? Do you link-edit or not? Did you try the "DLL-PRT" trick?
I know the "DLL-PTR" option works for version 4 and higher.
Maybe you can try
Code:
 CALL "c:\blabla\QPR.DLL"
in you init instead of the "DLL-PTR" option. But that's only when you do not link-edit. When you do lihk-edit, you just include the DLL in your ".EXE".

If all the above is clear, can you try to explain the problem again?
 
I don't understand your explanation of the DLL-PTR process.

I am linking the application .EXE with the shared run-time system. No modules are linked with it. Most sub-programs are .GNT or .INT. As the .DLL is from a third party, I cannot change its format.

I will try changing my call literal as you suggest.

Thank you.
 
I just changed the literal and still got error 165. Please explaing the DLL-PTR process in a little more detail.

Thank you.
 
I'm not at the office now so I hope you can wait untill monday. But another hint: did you investigate all the possible options of the "CBLLINK" utility? Since you compile & link your application in ".exe" format you should try to include the external ".dll" in your link-edit! If that works your module will be included in the RTE and cobol programs shoud be able call (static) the module (even ".gnt" subprograms).

When you go thru Google you'll hit DB/2 and Orcacle sites explaining how to include their stuff in cobol. That is the same logic you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top