Skip to main content

Problem:

A COBOL .NET application fails to use Fileshare.

Resolution:

You cannot have a COBOL .NET application to use Fileshare directly. An unmanaged (non-.NET) Cobol application compiled with $SET CALLFH"FHREDIR" can however be used with Fileshare and called by a .NET application. Therefore, you can consider one of the following options:

create the Cobol application that uses Fileshare as a COM object, add a reference to your managed code project, and invoke the COM object

OR create it as a Windows DLL, add it as a reference in a managed COBOL .NET project, and use platform invoke to call it.  You could then have your .NET (e.g. VB .NET) project call the managed COBOL project that will call the unmanaged COBOL that uses Fileshare. There is an example of using pinvoke in the .NET examples (C:\\Program Files\\Micro Focus\\Net Express with .NET\\Examples\\Pinvoke)

Old KB# 3940

#COBOL
#AcuCobol
#RMCOBOL
#netexpress
#ServerExpress