Exception occurs when native Dialog System program calls managed WinForm



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?


Try setting the following environment variable in your computers environment


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.

Comment List
Related Discussions