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