Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27508

VS 2010 COM Interop Issue

$
0
0
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:

vb.net Code:
  1. <Microsoft.VisualBasic.ComClass(SpeechRecognition.ClassId, SpeechRecognition.InterfaceId, SpeechRecognition.EventsId)> Public Class SpeechRecognition
  2.  
  3. #Region "Public Constants"
  4.     Public Const ClassId As String = "[I]some string[/I]"
  5.     Public Const InterfaceId As String = "[I]some string[/I]"
  6.     Public Const EventsId As String = "[I]some string[/I]"
  7. #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:
  1. 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?

Viewing all articles
Browse latest Browse all 27508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>