Possible Bug

Hi,

I'm not sure if this is a bug or not: When I encounter a problem/exception case in my .NET Form, I execute My.InteropToolbox.EventMessenger.RaiseApplicationEvent("CRITICAL_ERROR", My.Resources.SampleErrorCode). The error is successfully raised back to my VB6. In the VB6 Sub that handles this application event, I display a messagebox and Unload all the forms. The problem is that no matter what approach I take, my .NET form continues to execute any and all lines AFTER the call to .RaiseApplicationEvent. It does not know that I don't want to execute any code after I call it.

Therefore, as my VB6 client may be displaying a message or actually unloading all forms and closing itself up (due to a critical error), code is still executing in the .NET client. Is there a way to call the RaiseApplicationEvent and make it block so that it actually does not continue to run code? To test, I simply added a "Throw New IO.DirectoryNotFoundException" after both to my test project and the sample code that came with the InterOp Forms Kit 1.0 and it actually fired the Throw event. I need to be able to detect a problem in me .NET code (Form_Load) event, call the RaiseApplicationEvent, and stop all execution. Is there any way to do this?

Regards,

Giovanni

[1312 byte] By [GiovanniP] at [2007-12-26]
# 1

After you call the raiseapplicationevent, can you just call

me.close()

and this will close the form for you and should not execute any more code. Does that work?

Toddap_MS

Toddap_MS at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Interop and Upgrade...