Solved

CoCreateInstance - Class not registered

Posted on 2006-11-09
7
1,651 Views
Last Modified: 2007-11-27
Hello-

Having problems with CoCreateInstance:

Here is the call I'm making:
CComPtr<_ComTestData> comTest;
hr = CoCreateInstance(__uuidof(_ComTestData), NULL, CLSCTX_SERVER, IID__ComTestData, (void**)&comTest);

After the CoCreateInstance, hr = 0x80040154, aka Class not registered.  This class is contained in an activex control, which I've imported in stdafx.h via:

#import "C:\PathToMy\ActiveXControl.ocx" named_guids

I've checked the registry via regedit, and the class appears in the registry and to be sure I have unregistered and reregistered the control several times with regsvr32.

Any suggestions on this?  I'm at my whits end.
thanks!
0
Comment
Question by:PhilC
  • 4
  • 3
7 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Have you also tried

hr = CoCreateInstance(CLSID_ComTestData, NULL, CLSCTX_SERVER, IID__ComTestData, (void**)&comTest);

?
0
 

Author Comment

by:PhilC
Comment Utility
Yes.  I've tried every iteration of everything I can think of and nothing works.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
Then I'd try 'RegMon' (http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/Regmon.mspx) and check what data in the registry is actually being accessed and find what's going wrong.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:PhilC
Comment Utility
Ah.  Nice tool.  I'll give it a try, thanks.
0
 

Author Comment

by:PhilC
Comment Utility
Ok, got side tracked off this for a couple days-

What I found is that the InprocServer32 value for this ComTestData object is non-existant.  I tried adding it, based on other objects that work fine from the same control, and its giving me a class factory cannot provide requested class.

I suspect something was/is wrong with this control, would that be a reasonable assumption?
0
 

Author Comment

by:PhilC
Comment Utility
Never mind, I was doing something very very wrong.  Thanks for the help though, that tool was very useful.
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
You're most welcome ;o)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 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

12 Experts available now in Live!

Get 1:1 Help Now