Releasing SpeechLib COM via .NET DLL 
Author Message
 Releasing SpeechLib COM via .NET DLL

I have an application that is written in vb.net that instantiates vb.net DLL
(Class library) that references and uses SpeechLib (Interop.SpeechLib.dll)
which is the SAPI 5.1 wrapper for .net

My application is iterating a large list of files and creating an object for
each of them (one at a time) that object, in turn, is creating an instance
of the Speech recognizer, recognizing a short recording, then shutting down
and sending an event to the calling program, which then forces it to release
all of its memory via calls to ReleaseComObject like:

While (ReleaseComObject(mRecoContext) > 0)
End While
Debug.WriteLine("Released mRecoContext")

While (ReleaseComObject(mGrammar) > 0)
 End While
 Debug.WriteLine("Released MGrammar")

And the Released messages are flowing nicely.
Yet, even though I do this, I still am getting a "storage not available"
error from SpeechLib after about the 35th or so iteration.

So my chain of events is this
Main Program (X)--> instatiates class (A) from .Net DLL --> instantiates
SpeechLib Com Object (SL) -->  (SL) starts Asynch recognition

--> (SL) When recognition is complete --> (A) raises event to calling
class --> calling class (A) calls ReleaseComObject(SL) --> Loops

Any suggestions?  I am porting this from VB6, where it works without this
error because i suspect the setting of the SL objects to nothing actually
does this.

Thanks
Jeff Gallino



Mon, 23 May 2005 00:54:54 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. releasing a Com Server reference from Vb.Net

2. Automation error referencing .net dll from com (com interop)

3. COM DLL used in ASP page won't release

4. Accessing .net interface via COM

5. COM-Gen 2000 - Build 107 released - generates COM objects

6. COM-Gen 2000 - Build 153 released - generates COM objects

7. COM-Gen 2000 - Build 153 released - generates COM objects

8. COM-Gen 2000 - Build 107 released - generates COM objects

9. COM-Gen 2000 - Build 153 released - generates COM objects

10. COM-Gen 2000 - Build 107 released - generates COM objects

11. COM-Gen 2000 - Build 153 released - generates COM objects

12. COM-Gen 2000 - Build 107 released - generates COM objects

 

 
Powered by phpBB® Forum Software