Quantcast
Channel: Visual COBOL Knowledge Base
Viewing all articles
Browse latest Browse all 214

Exception occurs when native Dialog System program calls managed WinForm

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Angela on 3/19/2013 9:09:02 AM

PROBLEM:

Customer has a native Dialog System application that displays a window on which an ActiveX control resides.

This native application displays this Dialog System window and then calls a managed code .Net WinForm application that displays a Windows Form which also has an ActiveX control on it.

When the program does this it gets the following exception:

    Application Exception  A device attached to the system is not functioning.

What is causing this to occur?

RESOLUTION:

Try setting the following environment variable in your computers environment

MFOLECL_NO_THREAD_INIT=ON

This is a problem that is caused by the Micro Focus native OLE support calling CoInitialize on a thread that it did not own, mainly the managed code thread.

If this environment variable is set the OLE support will not try to initialize a thread that it does not own.


Viewing all articles
Browse latest Browse all 214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>