Knowledge Base

PRB: AUDIOSD Sample Returns E_FAIL from CoCreateInstance

PSS ID Number: Q147122

Article Last Modified on 12-7-2001


The information in this article applies to:


Symptoms

When an application attempts to create an instance of the CLSID_MyAudioSource or CLSID_MyAudioDest object contained in the AUDIOSD.DLL, CoCreateInstance() returns an HRESULT of E_FAIL.


Cause

The DllGetClassObject() function in the AUDIOSD sample will always fail because it compares the CLSID passed into CoCreateInstance() with CLSID_MMAudioSource and CLSID_MMAudioDest rather than the correct CLSID_MyAudioSource and CLSID_MyAudioDest. This will cause DllGetClassObject() to return E_FAIL, which in turn is returned from CoCreateInstance().


Resolution

Edit the DLLGetClassObject() function found in the Cf.cpp file of the AUDIOSD sample as described below and recompile the sample:

  1. Replace both instances of CLSID_MMAudioSource with CLSID_MyAudioSource.


  2. Replace both instances of CLSID_MMAudioDest with CLSID_MyAudioDest.



Status

This behavior is by design.

Additional query words: SAPI 1.00

Keywords: kbmm
Issue Type:
Technology: