pure virtual function call C++ error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alex Rootes

    pure virtual function call C++ error

    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.


  • Rob Richardson

    #2
    Re: pure virtual function call C++ error

    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


    Comment

    • Alex Rootes

      #3
      Re: pure virtual function call C++ error

      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.


      "Rob Richardson" <notreally@n2ne t.net> wrote in message
      news:%231dPfCiJ EHA.3548@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > Alex,
      >
      > It seems to me that somehow you are occasionally calling this function[/color]
      with[color=blue]
      > 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[/color]
      happen[color=blue]
      > 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[/color]
      like[color=blue]
      > a bug in the COM object.
      >
      > Good luck! (You'll need it.)
      >
      > Rob
      >
      >[/color]


      Comment

      • Rob Richardson

        #4
        Re: pure virtual function call C++ error

        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


        Comment

        Working...