Native/Managed System

We are implementing a system that we are transitioning from Native to Managed. We already have the native code running in Visual Cobol. We have started replacing some native programs with managed code. We still use our native menu to select functions to run. When a manage function is selected from the menu we create a thread to run the managed function. So we currently have a functioning hybrid system, where the user sees a single menu for both Native and Managed function.

Our problem is that we want to rewrite the menu using managed code. The ideal way to implement this would be to have a way for the managed runtime to raise an event in the native runtime. The question is does anybody know if there is anyway for the Native runtime to communicate with the Managed runtime?  If not, is this something that could be added?

  • Verified Answer

    I have been corresponding with Norm privately through a support incident. We do provide examples on using this native/managed communication within the Samples Browser if the Compatibility Addpack is installed (Dialog System components). There are a couple demos available that show how to pass a pointer to a native entry point to a managed program so that it can be called from managed. There is also a demo that shows how a .NET program packaged as an activex control can generate events that can be consumed by the native program using an OLE control program approach.

    Creating this type of hybrid system is certainly not for the faint of heart.