pure virtual function call C++ error

  • Thread starter Thread starter Alex Rootes
  • Start date Start date
A

Alex Rootes

Hi,

I have a multi-threaded, vb.net service which access a database at a high
rate and makes use of com interop components (It is running on Windows XP
Pro and has been built in VS 2003). I get no error's when in debug build,
but in release build I sporadically receive the following error:

Microsoft Visual C++ Runtime Library:
Runtime Error!
Program: blah.exe

R6025
-pure virtual function call.


The service continues to run until the ok button is clicked, then the
service is stopped. I have very little idea what could be causing this and
ideas are welcome. I have updated to ado 2.8 but this hasn't seemed to
improve the situation.

Any help on this would be much appreciated :)

Alex.
 
Alex,

It seems to me that somehow you are occasionally calling this function with
arguments of the wrong type. The COM object you are calling was not
designed to handle whatever arguments you are sending it, and its designer
accidentally left a bad function available. "Pure virtual" means "This
function can't be used. When you derive a class from this class, you must
override this function." The only way I can think of that this could happen
is if you are using an instance of a derived class and the library code
explictly calls the base class's version of a function.

None of this makes any sense to me. The bottom line is that this looks like
a bug in the COM object.

Good luck! (You'll need it.)

Rob
 
Thanks for the prompt reply Rob :)

Unfortunately I think you may be correct, a COM error is most likely - but I
am confused as to why this error occurs only in a release build, and even
then after a rather random period of time (about 1 - 2 minutes). If a call
was incorrect would it break on the first use? The service makes repeated
calls to the same methods (very fast) but it seems to break when it is
heavily loaded.

Alex.
 
Alex,

I'm afraid I can't help you with that. Apparently the COM object is getting
into an unanticipated, untested state as you are stressing it. I've never
heard of a run-time call to a pure virtual function before. I was a C++
programmer for a long time, and I've had said that it was impossible.

Rob
 
Back
Top