PRB: AUDIOSD Sample Returns E_FAIL from CoCreateInstance

ID: Q147122


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 MMSpeech 
Version           : 1.00 | 1.00
Platform          : NT WINDOWS 
Issue type        : 

Last Reviewed: March 6, 1999