I'm currently working with a rather old Borland C++ application, which is using an ActiveX component to draw some graphics. In the application multiple windows with the ActiveX comp. can be open at any time - these can either show the same graphics (different zoom factor etc), or different graphics. 

The application is for positioning, and the ActiveX is drawing and showing positions of different units. 

Around 10 times a second the Borland application got a new position, and finds out which forms (and their ActiveX) needs to know about the updated position in order to draw it. This have been going well for a long time, but I have had to do quite some changes in the ActiveX for a new version of the product.

About a year ago I had to do some minor changes in the component aswell, and I found that the application could end in a state, causing an "index out of bounds" error in the component. The result of this was not an error getting shown or the program terminating, but instead the application started to use a huge amount of memory - and kept going up very fast. At some point it stopped and the component that had the error simply stopped showing anything (stopped drawing itself).

Now with the recent changes I have made, I have the same problem where one of the components seems to get an error, which is not getting shown, and instead it is not redrawing itself, and the memory use is going sky-high. On some PC's it seems that an Access Violation is thrown - which is saying that the error happened in the OCX, but on the PC I develop on, I cant get this Access Violation in any way.

Also I cannot track down exactly when the error happens - ie what is causing the error. I can run the same setup 10 times in a row for 15 minutes, sometimes it happens that the memory use go up and a component bug, other times nothing happens and it runs as it should for the whole duration. 

As it is an OCX, it is registered using regsvr32, and is therefore code-wise not part of the main application. Therefore I can not use breakpoints and debug it that way. 

I am pretty sure that some error is happening inside the component, which is not passed on, so I cannot see what it is.

So do anyone know how I can debug this? Can I somehow make the OCX log any errors that happens, or make it show the error, or what can I do?

Any help would be much appreciated - been trying to track down the error for 3 days now with no result what so ever.