Highlighted
Contributor.
Contributor.
1025 views

VC Not Playing Well With Others

Jump to solution

I'm trying to call a DLL that I wrote in C# from a GNT called from a native COBOL program.  The call is failing with "Server defined OLE exception" (800401F3): Invalid class string...."  Now, from past experience, this usually means that the DLL is not registered.  However, I did register the DLL.


Now, here's the weird part.  If I remove the GNT from the equation, the call to the DLL works fine.  So I can call the DLL from a native cobol program, but not from a GNT written in native cobol called by the native cobol driver.


I've attached the source code that I'm working with.  Program1.cbl is the driver.  Compress.cs is the code for the DLL.  Ziphandd.cbl is the GNT making the call.  None of the programs are very complicated.


Any suggestions would be most welcome.


Mike

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: VC Not Playing Well With Others

Jump to solution

Your copybooks are missing from the zip but the first thing I immediately noticed is that you are defining the COM class name incorrectly in the .gnt program.

In program1.cbl:

  COMPRESSOR IS CLASS "$OLE$IOICompression.Compress".

In ZIPHANDD.CBL:

  COMPRESSOR IS CLASS "$OLE$IOICompress.Compress".

According to the name in the C# class the name in program1.cbl is correct so that is why it works from there.

Thanks.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: VC Not Playing Well With Others

Jump to solution

Your copybooks are missing from the zip but the first thing I immediately noticed is that you are defining the COM class name incorrectly in the .gnt program.

In program1.cbl:

  COMPRESSOR IS CLASS "$OLE$IOICompression.Compress".

In ZIPHANDD.CBL:

  COMPRESSOR IS CLASS "$OLE$IOICompress.Compress".

According to the name in the C# class the name in program1.cbl is correct so that is why it works from there.

Thanks.

View solution in original post

0 Likes
Highlighted
Contributor.
Contributor.

RE: VC Not Playing Well With Others

Jump to solution

Chris - Thanks for helping out.  I must've looked at that 50 times, and I had someone else look at it and neither of us caught that.  Sometimes the answer is tricky to find, sometimes it's right under ones nose.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.