We have a hybrid application that runs both native and managed functions from a native menu. The first program run is managed. I want to start a message loop in this program then show each managed form with the Form::Show() method. When I execute Application..Run(ApplicationContext) in the debugger the output window displays "Step into: Stepping over non-user code 'System.Windows.Forms.Application.ThreadContext.ThreadContext'" and it just hangs.
This is my code:
class-id. Mgload as "Mgload.Mgload".
method-id Startup static attribute STAThread()
local-storage section.
01 context type MgLoad.MyApplicationContext.
procedure division.
set context to new type MgLoad.MyApplicationContext
invoke type Application::Run(context)
goback.
end method.
end class.
$set ilusing"System.Windows.Forms"
class-id MgLoad.MyApplicationContext
inherits from type System.Windows.Forms.ApplicationContext.
working-storage section.
method-id MyApplicationContext private.
local-storage section.
procedure division.
invoke type MessageBox::Show("Arrived !")
*> start up my native menu
goback.
end method.
end class.
I am also uploading the project for this.