Solved

CoCreateInstance augers in.... how to debug?

Posted on 2004-08-25
6
1,088 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
  • 3
  • 3
6 Comments
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:charles_gilley
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

728 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

9 Experts available now in Live!

Get 1:1 Help Now