Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C++ COM object debugging notes

Posted on 2001-09-01
3
Medium Priority
?
605 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
3 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 800 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

916 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