Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CoCreateInstance augers in.... how to debug?

Posted on 2004-08-25
6
Medium Priority
?
1,112 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
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 

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 1500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

718 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