Solved

C++ COM object debugging notes

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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

632 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