Error in COM (SAPI.dll)

Hi,

RecognizerObj = new SpInprocRecognizer(); //Error occured here.
stream = new SpCustomStreamClass();
MyASRStream = new ASRStreamClass();

Retrieving the COM class factory for component with CLSID
{41B89B6B-9399-11D2-9623-00C04F8EE628} failed due to the following error:
80040154.

I am using C#.Net 2.0. How to solve this error please help me.

I tried registering using regsvr32 and tlbimp and regasm tools, but nothing
helped me.

please help me.

Regards,
R. Pandiarajan.

godwindotnetAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kaylanreilorConnect With a Mentor Commented:
Lauch OleView. In Object Classes expand "All Objects". Look for the object you want to set its properties. I've taken the example of SpCustomStreamClass.
Check the box "Use Surrogate Process" => will allowed this object to be instanciated from another process and this will be loaded in dllhost.

But really, I still don't understand why you want to register anything as a "DCOM" object.
OleViewer.GIF
0
 
kaylanreilorCommented:
The error means that the class is not registered, so when you use regsvr32 what is the message ?
0
 
kaylanreilorCommented:
I suppose that when you use tlbimp you write something like this:
tlbimp sapi.dll /out:NETSapi.dll
And then in your .Net project you add a reference on NETSapi.dll ?
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
godwindotnetAuthor Commented:
Hi thanks for your quick response.

I got this message. When I register the com component regsvr32 sapi.dll
"DllRegisterServer in sapi.dll succeeded." appears at messagebox.
I tried your second suggestion also.
TlbImp sapi.dll /out:speechlib.dll ,
but that also not worked for me. Somebody is telling that I should register as DCOM object I tried that by dcomcnfg tool but I don't know how register as DCOM object. And also I tried installing as COM+ service in dcomcnfg tool.
Please tell help me out.
0
 
kaylanreilorCommented:
You have to register it if it is supposed to be used from another machine.

I just realize that you don't need any Type Library Importer tool because SpeechLib.dll should already exist on your machine.

If I add a reference on SpeechLib.dll and I do something like the following, it works for me :
using SpeechLib;
 
namespace UseAxImp
{
    public partial class SampleControl : Form
    {
        public SampleControl()
        {
            InitializeComponent();
        }
 
        private void SampleControl_Load(object sender, EventArgs e)
        {
            SpeechLib.SpInprocRecognizer rec = new SpInprocRecognizer();
            SpeechLib.SpCustomStreamClass sp = new SpCustomStreamClass();
        }
    }
}

Open in new window

0
 
kaylanreilorCommented:
Just a small correction:
"You have to register it if it is supposed to be used from another machine." => I meant registering AS DCOM OBJECT.
0
 
godwindotnetAuthor Commented:
Hi,
No I don't find any dll speechLib.dll in my system.
I know normal regsv32 registration, How do I register as DCOM object?
Thanks,
R. Pandiarajan.
0
 
kaylanreilorCommented:
Open Visual Studio 2005 Command Prompt. Navigate to where sapi.dll is located.
Then execute this line:
tlbimp sapi.dll

=> tell me what's happen but the principal result is that the last line displayed should be "Type Library imported to SpeechLib.dll"
0
 
kaylanreilorCommented:
I don't understand why your interested in DCOM.  Is the sapi.dll supposed to used on another machine ?
0
 
godwindotnetAuthor Commented:
Hi,
When I click the class, Its showing "Unsupported operation was attempted". Whatever the concept it is I am needing to run the component. I am stick to DCOM.

I installed sapi via "C:\WINDOWS\inf\sapi5.inf" but now it shows different errors.

Creating an instance of the COM component with CLSID {3BEE4890-4FE9-4A37-8C1E-5E7E12791C1F} from the IClassFactory failed due to the following error: 80004027.

Thanks Again Please help me.

RecognizerObj = new SpSharedRecognizer(); // error occurs here.
            stream = new SpCustomStreamClass();
            MyASRStream = new ASRStreamClass();
            objRecoContext = new SpSharedRecoContext();

Open in new window

0
 
godwindotnetAuthor Commented:
>> I am stick to DCOM.
Sorry I am not stick to DCOM, whatever the concept it is What I need is a solution.
0
 
kaylanreilorCommented:
Your error means : The Component or application containing the component has been disabled.
I don't know what happenned on your machine but I would like to talk about this later if needed.

But anyway, did you exactly do what I've said in my post #20874311 ?
Open Visual Studio 2005 Command Prompt. Navigate to where sapi.dll is located.
Then execute this line:
tlbimp sapi.dll
=> tell me what's happen but the principal result is that the last line displayed should be "Type Library imported to SpeechLib.dll"

If you have a SpeechLib.dll generated on your machine you can then go back to the post #20865955.
0
 
godwindotnetAuthor Commented:
Hi,
How can I get 20874311  post and 20865955 posts. I searched in experts-exchange it shows my current post only. Please Help me.

Regards,
R. Pandiarajan.
0
 
kaylanreilorCommented:
This is in THIS discussion, just above. I wrote :
Open Visual Studio 2005 Command Prompt. Navigate to where sapi.dll is located.
Then execute this line:
tlbimp sapi.dll
=> tell me what's happen but the principal result is that the last line displayed should be "Type Library imported to SpeechLib.dll"

Please, for the third time, just do that and tell me if you got the newly created SpeechLib.dll.

If yes, do what I post in #20865955 (in THIS thread) four days ago.
0
 
godwindotnetAuthor Commented:
Thanks for response.
I tried by using tlbimp that didn't help me. Again the same problem. Actually I  formatted and reinstalled everything , now it is working.  I installed DirectX SDK, Platform SDK and then Speech SDK. That fixes this problem, But I don't know how it is working...!

Regards,
R. Pandiarajan.
0
All Courses

From novice to tech pro — start learning today.