I'm trying to access a VB6 OCX via C# using late binding.
I am able to Invoke the Methods using the Reflection / InvokeMember, however, I do not know how to consume the events generated by the OCX.
Im instantiating the OCX using the CreateInstance Method.
Code Snippet:
Type t = Type.GetTypeFromProgID("MyOCX");
object test = Activator.CreateInstance(t);
t.InvokeMember("LaunchBrowserWindow", System.Reflection.BindingFlags.InvokeMethod, null, test, new object[] { "cnn", "www.cnn.com" });
The above code works fine and it does Launch the Browser. If the user closes the Browser window that just opened, the OCX Triggers a "CloseWindow" event. How can I consume that event?