Solved

CoCreateInstance augers in.... how to debug?

Posted on 2004-08-25
6
1,097 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
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
A short article about problems I had with the new location API and permissions in Marshmallow
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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