Solved

C++ COM object debugging notes

Posted on 2001-09-01
3
589 Views
Last Modified: 2006-11-17
I have a COM object that runs correctly in the debugger when using an MS Visual C++ client driver in Windows 98, all return flags are valid (0x00) and no unusual messages are generated in the debug window.

I ran the COM object through the debugger using an MS VB client as a driver program, again in Windows 98. The program runs correctly but I notice the C++ debug window notes a first chance exception is raised during the call to CoUninitialize():

(MSADCE.DLL): 0xC0000005: Access Violation.

Note: the message is issued but the program terminates without throwing an exception.

I found a note in MSDN saying that this message is occasionally raised by CoUninitialiize() and can be "safely ignored."  ( WHAT?! )

Finally, when a colleague tested my COM object using a MS VB client on Windows NT, the program crashed and raised a memory read exception 0x0000008

It is required that the COM object should run on Windows NT. Is anyone able to point me in the right direction or give me some ideas?

0
Comment
Question by:jtm111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 6448427
>> ...and can be "safely ignored."  ( WHAT?! )

When the MS dox say that it usually means that the error is trapped and fixed by a higher level exception handler.

It is fairly common.  You should see the stream of them that appears when hosting a webbrowser control.

>>... the program crashed and raised a memory read exception 0x0000008

Did this happen at the very end... at the same time that you would have see the message in the trace screen?  What I'm saying is... is there any chance that this crash was not related to the unhandled (yet handled) expection?

If you are fairly certain that this is the issue, then the problem may relate to an try...catch that you use in the area.  When an exception occurs in an exception handler, things can go round and round and get pretty nasty.   If so, try removing your own try...catch handling and check the result.

-- Dan
0
 
LVL 1

Expert Comment

by:kanejin
ID: 6453005
We can generally ignore the 1st exception because it should be handled by the program itself. (Q105675)

For the problem you met on NT, you can check the code and verify there is no memory leak.
0
 
LVL 3

Author Comment

by:jtm111
ID: 6467178
Thanks, I was convinced the exception was not being handled. You saved me at least a week of wasted effort trying to solve the wrong problem.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question