Question

I have created a visual basic application and it uses an OCX resource for office documents. Now, while I use the application everything seems to work fine, but when i exit the application it hangs with an access violation error (most of the time). This happens ONLY when i try to close the entire application.

I have tried to debug it, although it only shows a disassembly window stopped on an instruction mov eax,dword ptr [edi+4] and the call stack pointed on that specific OCX.

As the specific OCX is created by a third party developer, so I cannot modify it, is there a way to at least handle this exception? Or any other thoughts regarding this issue?

Thanks a lot!

Was it helpful?

Solution

There's no way to handle the error, which sounds like a bug in the OCX, but you might be able to prevent it. Make sure you've got the latest version. Make sure there's nothing you need to dispose or close. Make sure all of the OCX functions have completed when you exit the application. As a last resort, you can try changing or commenting out some function calls to the OCX to see if anything makes a difference.

Now would be a good time to start looking for an alternative to the OCX.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top