Use vb.net in VBScript

How to call a function in a vb.net dll from VBScript?

I did the following: - I am creating an open class called Class1 in vb.net.

  • I go to Visual Studio 2008 Command Prompt and go to the dll class - C: \ Myapp \ bin \ Debug and enter the following tlbexp myDLL.dll command after that, I get the Assembly message exported to C: \ Myapp \ Bin \ Debug \ myDLL .tlb

  • After that, I print the following regasm myDLL.dll command, and I get the following RegAsm message: warning RA0000: no type was registered

This is what my class looks like:

Public Class Class1
   Public Function ADD(ByVal first As Integer, ByVal sec As Integer)
        Dim abc As Integer
        abc = first + sec
        Return abc
    End Function
    Public Function Subtraction(ByVal first As Integer, ByVal sec As Integer)
        Dim abc As Integer
        abc = first - sec
        Return abc
    End Function
end class

Where am I making a mistake and this is the easiest way to use vb.net from vbscript!

Many thanks!

+2
source share
1 answer

. ? ?

Visual Studio. , "register for COM" "make COM visible", .

0

Source: https://habr.com/ru/post/1789315/


All Articles