Ok, I thought I followed all the steps correctly, but apparently I am still missing something. I have a very simple .NET assembly that references the System.Speech.DLL. I have marked the project as COM visible and checked the box for Register for COM interop. I have added the following to my only class:
Once I create a TLB for my new dll, I am able to reference it from my VB6 COM app. The problem is, as soon as I try to instantiate the .NET class, I am getting an invalid procedure call or argument. The problem lies in the constructor of the .NET assembly where it tries to execute this line:
The System.Speech.dll is in the GAC on the target system.
Any ideas on how to correct this?
vb.net Code:
<Microsoft.VisualBasic.ComClass(SpeechRecognition.ClassId, SpeechRecognition.InterfaceId, SpeechRecognition.EventsId)> Public Class SpeechRecognition #Region "Public Constants" Public Const ClassId As String = "[I]some string[/I]" Public Const InterfaceId As String = "[I]some string[/I]" Public Const EventsId As String = "[I]some string[/I]" #End Region
Once I create a TLB for my new dll, I am able to reference it from my VB6 COM app. The problem is, as soon as I try to instantiate the .NET class, I am getting an invalid procedure call or argument. The problem lies in the constructor of the .NET assembly where it tries to execute this line:
vb.net Code:
Dim oSpeechEngine As New SpeechRecognitionEngine(New Globalization.CultureInfo("en-US"))
The System.Speech.dll is in the GAC on the target system.
Any ideas on how to correct this?