Absent Member.
Absent Member.

native to managed


I am facing a problem while calling a program in managed dll from native dll.

When a normal call is made from native to managed, it is giving the error code 173 program not found.

I have tried copying the managed dll into the debug folder of native project. Also, I have tried including the procedure pointer of managed dll in native code. But it gives the same error every time.

is there any pointers on how to proceed or what should be done when we need to call managed from native?



1 Reply
Micro Focus Expert
Micro Focus Expert

You cannot call a managed code assembly (.dll) directly from a native COBOL program using the CALL statement. You must instead build the managed code .dll for use with COM Interop and register it and then call it using the COM client support in the native OLE class libraries.

This is covered in the docs here:

An example can also be found here.

This example uses Net Express to develop the native program which calls a managed .net Visual COBOL assembly but the same source can be used in a Visual COBOL native project.

There is also a tutorial covering this topic here:

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.