Solved

CoCreateInstance augers in.... how to debug?

Posted on 2004-08-25
6
1,103 Views
Last Modified: 2013-12-27
I have the following code (fragment below) that worked *perfectly* for the past 8 months.  Short of removing it and generating a lot of work for me in the next 48 hours, time I do not have, I need suggestions for debugging this.

Fragment:

      hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
      if (SUCCEEDED(hr))
      {
            // Create instance of engine COM server.
            hr = CoCreateInstance(CLSID_EngineData, NULL, CLSCTX_INPROC_SERVER,
                  IID_IEngineData, (void**) &m_pIEngineData);
            if(!SUCCEEDED(hr))
            {...


Some system specifics:
  Target device is an x86 cpu running Windows CE.net 4.1.
  I have multiple custom activeX controls in this project, all apartment threaded.
  I have a COM dll that has not changed in many months.  Code fragment above loads this COM object.
    threading is apartment as well.

Execution comes to this code and executes the CoInitializeEx and proceeds to the CoCreateInstance.  Attempting to execute the CoCreateInstance (in debug) I receive a dialog:  "User breakpoint called from code at 0x1dc6fa46."  At this point I'm stuck in assembly code, the call never returns and I have no error code.

Any ideas how to go about diagnosing this?  My current thoughts are that I #$% something up on my target device or on my development laptop, but without an error code, I don't know what.  I've re-registered everything, so short of just deleting the code (and avoiding the problem), I'm stuck.

This issue is critical as it has brought my progress to a standstill, hence the high point value.  I'll throw in some donuts as well.
0
Comment
Question by:charles_gilley
[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
  • 3
6 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 11898268
What does the call stack look like when it breaks in the debugger? Do you have all the source code especially the COM object (CLSID_EngineData)?
0
 

Author Comment

by:charles_gilley
ID: 11898517
No, and this is the most frustrating thing - nothing but pure assembly and hex code.  

For what it's worth, I've even gone back three prior build versions, spanning 3 weeks, and they all fail in the same way.  So, common thread is the development environment and target device.  
0
 
LVL 23

Expert Comment

by:chensu
ID: 11898558
Since it worked for the past 8 months, what has changed? Can you create a small new application simply doing the CoCreateInstance() to see what happens?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:charles_gilley
ID: 11898698
All of my activeX stuff is GUI related, so I have created a simple app and validated that each of them load and execute correctly.  I've not trimmed down the application for three reasons: 1) hadn't thought of it, 2) time constraints, and 3) (this is the main one), the CoCreateInstance happens so early in the application launch that I just didn't think it was necessary.  Yet, you have a valid point, and it is something I can do easily.

I'm on USA East Coast time, and my batteries are shot.  I may get a chance to post results tonight, but more likely tomorrow morning.  Chensu, I appreciate the questions....
0
 
LVL 23

Accepted Solution

by:
chensu earned 500 total points
ID: 11898858
If you can reproduce the same problem with a standalone application, the bug is likely in the COM object. If not, you will need to look into your application.
0
 

Author Comment

by:charles_gilley
ID: 12041114
Chensu - turns out that there was a major memory bug lurking since who knows how long (8 months at least :)).  Once I located that, the crash went away.  I then ripped the COM code out, since I wasn't really using it anyway.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mini HDMI, Micro HDMI, or what?? 6 72
What is the MTK logger, is this a virus ? 6 42,214
moto 4g plus phone applications 2 57
Undo Sprint PCS iPhone 7 Plus iOS upgrade 4 58
Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

734 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