?
Solved

CoCreateInstance - Class not registered

Posted on 2006-11-09
7
Medium Priority
?
1,663 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
ID: 17909648
Have you also tried

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

?
0
 

Author Comment

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

Accepted Solution

by:
jkr earned 2000 total points
ID: 17909816
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Author Comment

by:PhilC
ID: 17938407
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
ID: 17939310
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
ID: 17939809
You're most welcome ;o)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

862 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