CoCreateInstance(CLSID_SpVoice); fails with Class not registered
-
I am using Microsoft speech sdk v 11 (https://msdn.microsoft.com/en-us/library/jj127898.aspx[^]). the below call fails, when I check GetLastError, observed that it fails to message "Class not registered". visual studio 2008, windows 7
hr = cpVoice.CoCreateInstance(CLSID_SpVoice);
Please advise
-
I am using Microsoft speech sdk v 11 (https://msdn.microsoft.com/en-us/library/jj127898.aspx[^]). the below call fails, when I check GetLastError, observed that it fails to message "Class not registered". visual studio 2008, windows 7
hr = cpVoice.CoCreateInstance(CLSID_SpVoice);
Please advise
When using Windows 7 64-bit, check if you have installed the version of the Microsoft Speech Platform - Runtime that matches your project settings (32 or 64 bit), or just change your project to match the installed version.
-
When using Windows 7 64-bit, check if you have installed the version of the Microsoft Speech Platform - Runtime that matches your project settings (32 or 64 bit), or just change your project to match the installed version.
Thanks for response. project is 32 bit and I installed x86. I think that should be ok. what could be other reasons please advise. thanks in advance.
-
Thanks for response. project is 32 bit and I installed x86. I think that should be ok. what could be other reasons please advise. thanks in advance.
Did you have called CoInitialize[Ex] before? To check if it is registered you can look into the registry at HKCR\CLSID\value_of_CLSID_SpVoice. If it is not present, it may help to re-install the runtime.