473,387 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Making vb.NET dll callable in VBscript

Could anyone point me to where there is more information available on calling
a vb.net dll from a vbscript? I have found some links, but most are pretty
unclear as to what is needed.
Nov 21 '05 #1
1 4758
On your .NET side:

- Create a ClassLibrary with this code:

Public Interface MyInterface
Function Sum(ByVal i1 As Integer, ByVal i2 As Integer) As Integer
End Interface

Public Class Class1
Implements MyInterface

Public Function Sum(ByVal i1 As Integer, ByVal i2 As Integer) As Integer
Implements MyInterface.Sum
Return i1 + i2
End Function

End Class

- Register the class library for COM Interop (Project Properties window,
Build node)

On your VBScript side:

Dim objClass1 As Object

Set objClass1 = CreateObject("ClassLibrary2.Class1")

MsgBox objClass1.Sum(1, 1)

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
"G Leifheit" <GL*******@discussions.microsoft.com> escribió en el mensaje
news:0E**********************************@microsof t.com...
Could anyone point me to where there is more information available on
calling
a vb.net dll from a vbscript? I have found some links, but most are
pretty
unclear as to what is needed.

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Roy Smith | last post by:
I've got a function which gets passed a call-back function as a parameter. I want to check to make sure the thing passed in is indeed callable. Is: assert '__call__' in dir (param) the...
2
by: Mirko Zeibig | last post by:
Hello everybody, I recently stumbled across the proposal of removing `callable` in Python 3000 (http://python.org/peps/pep-3000.html) catching an exception instead, maybe something like this:...
10
by: Nicolas Fleury | last post by:
Hi everyone, I was wondering if it would make sense to make staticmethod objects callable, so that the following code would work: class A: @staticmethod def foo(): pass bar = foo() I...
34
by: Asfand Yar Qazi | last post by:
Hi, I'm creating a library where several classes are intertwined rather tightly. I'm thinking of making them all use pimpls, so that these circular dependancies can be avoided easily, and I'm...
5
by: ffrugone | last post by:
My scenario involves two classes and a database. I have the classes "Broom" and "Closet". I want to use a static method from the "Closet" class to search the database for a matching "Broom". If...
7
by: Antoon Pardon | last post by:
I have been reading http://www.python.org/dev/peps/pep-3100/ en there is written: To be removed: ... callable(): just call the object and catch the exception ...
16
by: Andrea Gavana | last post by:
Hi Diez & All, Do you mind explaining "why" you find it *buttugly*? I am asking just out of curiosity, obviously. I am so biased towards wxPython that I won't make any comment on this thread...
3
by: exiquio | last post by:
I am trying to figure out if there is a way to make an object in python callable, modules in particular. I wrongly assume that defining '__call__' in the the objects __dict__ would work. Any help...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.