I have a VB6 app. It's calling .NET code. The .NET code occasionally throws an Exception by design.
VB6 has an On Error Goto Statement in the Function calling the .NET code. When .NET throws an exception, the VB6 code should handle the error (in the Goto block), write the Err.Description to a log, and calls Err.Clear, and should proceed along it's way.
This works fine and as expected (as described above) when running the VB6 app from Visual Studio 6.0. When I run the VB6 app from a compiled exe, I see the expected error in my VB6 log file...but after the error occurs, the VB6 app hangs for a moment, then crashes unexpectedly. There isn't even an APPCRASH report in the Event Viewer.
Any ideas on how to troubleshoot this?
It does sound like a threading issue, even though you are saying that it's not the case. I'd start with a tool like Process Explorer and monitor what threads get created when the call is made. It could be inadvertent.
Secondly, I'd log the successful return from the .NET code as well - it is possible that the error occurs in your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With