Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i get REGDB_E_CLASSNOTREG when ActiveX object is in fact registered

Status
Not open for further replies.

arpito

Technical User
Aug 28, 2002
2
CA
using Visual studio 6.0

Generated the .h and _i.c file for a common registered object (ActiveX Real Audio) with MIDL and tried to use it a console project below, but i get a HRESULT of REGDB_E_CLASSNOTREG from CoCreateInstance.

The debugger and the registry shows the CLSID registered.
This code works fine when i use COM server objects built by me.

----------------------------------------------------------
// initialize the COM library
HRESULT hr;
hr = CoInitialize(NULL);
if (S_OK != hr)
{
printf("CoInitialize failed with %s\n", CommErr(hr));
return;
}

// instantiate RealAudio object and get its main interface
IUnknown* pI = NULL;
hr = CoCreateInstance(CLSID_RealAudio, NULL, CLSCTX_LOCAL_SERVER, IID_IRealAudio , (void**) &pI);
if (S_OK != hr)
{
// return with failure *** this is where the code fails***
printf("CoCreateInstance failed with %s", CommErr(hr));
return ;
}
-----------------------------------------------------------

Could someone shed a light on what i am doing wrong? I tried several different system supplied objects from the registry with the same result.

Much appreciate any help on this.
/arpad
 
stupid me i should have used CLSCTX_INPROC_SERVER for a dll instead of CLSCTX_LOCAL_SERVER, which is for out of process servers !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top