views:

15

answers:

1

I am using a very old OCX in a project and have set every 'ShowMessages' type property to false that I could find. Yet, every-so-often, an error occurs deep within its bowels and a message box is popped up. I know this because I run the code in a console application and see the messages pop up.

So my question is whether there is a way to prevent message boxes (or any form for that matter) from displaying in a console application or a service. I have a sneaky suspicion that when the code runs as a service the same thing happens (message box displayed) but since there is no user interaction the service just waits for someone to click the 'ok' button; so effectively it 'hangs'.

Any ideas welcome.

A: 

Can you wrap it in another .dll and catch errors and ignore them?

Beth
Hi Beth. Doing that already :( --- the OCX simply shows the message box and *that* is what is causing me the grief.
Eben Roux
sounds like it's not an error then, but a status message or something. does it raise any events?
Beth
It is actually an error message. Point is that it is showing it in a form / message box. I need to get rid of that somehow since it is causing problems. That is why I either need to know when it is being displayed or just prevent it and have the runtime throw an error w.r.t. *that*.
Eben Roux
An error handled by the application, not one a containing app can trap. I doubt you can get rid of it, and if there aren't custom events to respond to, you may not be able to tell when it appears. Do you know what condition it's handling? Maybe you can check for the same thing.
Beth
That is actually a good idea :) --- however, there is no documentation on-hand so I don't know if anything else is going to pop up in future. 16-bit OCX (if you can believe that). Thanks for your input.
Eben Roux