Solved

C++ COM object debugging notes

Posted on 2001-09-01
3
553 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 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now