Strange problems when I try to access a COM dll from VB script

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please help me with this problem:

I have an assembly dll (C#) which is "well prepared" for COM interop; so, I have registered it using Regasm and I have created the type library. I have used this command:
regasm MyAssembly.dll /tlb:MyAssembly.tlb
I have checked the registry and everything is registered properly.
I try to access from a VB script a class belonging to this dll, let's say MyClass. So, I did these things:

<reference object = "C:\Program Files\MyProduct\MyAssembly.tlb"/>

<script language="VBScript">
<![CDATA[
Dim myParams As MyAssembly.MyClass
Set myParams = Nothing
If (myParams Is Nothing) Then
Set myParams = New MyAssembly.MyClass End If
wscript.quit(0)
]]>
</script>

I have also added in PATH MyProduct path.
When I try to run the script, I receive the error: Cannot find the type library for this reference
What I do wrong here?

Thank you,
Ada
 
* =?Utf-8?B?QWRhIEJ5cm9u?= said:
I have an assembly dll (C#) which is "well prepared" for COM interop; so, I have registered it using Regasm and I have created the type library. I have used this command:
regasm MyAssembly.dll /tlb:MyAssembly.tlb
I have checked the registry and everything is registered properly.
I try to access from a VB script a class belonging to this dll, let's say MyClass. So, I did these things:

<reference object = "C:\Program Files\MyProduct\MyAssembly.tlb"/>

<script language="VBScript">
<![CDATA[
Dim myParams As MyAssembly.MyClass
Set myParams = Nothing
If (myParams Is Nothing) Then
Set myParams = New MyAssembly.MyClass End If
wscript.quit(0)
]]>
</script>

I have also added in PATH MyProduct path.
When I try to run the script, I receive the error: Cannot find the type library for this reference
What I do wrong here?

VBScript <> VB.NET.

<URL:<URL:
 
....... and the prize of understatement of the year goes to Herfried..... lol
__________________________________
The Grim Reaper

so, I have registered it using Regasm and I have created the type library. I
have used this command:
regasm MyAssembly.dll /tlb:MyAssembly.tlb
I have checked the registry and everything is registered properly.
I try to access from a VB script a class belonging to this dll, let's say MyClass. So, I did these things:

<reference object = "C:\Program Files\MyProduct\MyAssembly.tlb"/>

<script language="VBScript">
<![CDATA[
Dim myParams As MyAssembly.MyClass
Set myParams = Nothing
If (myParams Is Nothing) Then
Set myParams = New MyAssembly.MyClass End If
wscript.quit(0)
]]>
</script>

I have also added in PATH MyProduct path.
When I try to run the script, I receive the error: Cannot find the type library for this reference
What I do wrong here?

VBScript <> VB.NET.

<URL:<URL:
 
Back
Top