winforms - Catch an exception/error from an OCX hosted in a .NET Windows Form -


i have .net windows form use host older vb6 ocx form. that’s can’t run from! @ least now...

i’m not sure if paragraph useful, in case share information. in order load control, .net application provides configuration file contain information ocx control. load control using reflection, create instance activator.createinstance , cast object system.windows.forms.control. then, add .net form’s controls collection. approach works me.

so, want catch ocx exceptions , errors in .net form, or have way of knowing ocx form crashed. possible? did have similar experience? way, i’m using .net 2.0.

thanks.

since no-one more knowledgeable has answered yet...

  • if calling direct .net code method/property in vb6, errors raised in vb6 should propagate .net exceptions.
  • the vb6 code presumably include event handlers form , controls. need error handlers in routines, using on error goto. think unhandled errors crash application (there's no .net code in call stack beneath windows events). if want communicate errors .net, need invent mechanism so. raise custom event vb6 component, or provide callback vb6 .net.

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -