473,379 Members | 1,201 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,379 software developers and data experts.

DLL and VBScript

All,

I would like to write a DLL with a few function that are not available in
WMI. I know how to write a dll but is there anything special that I must
add to it if I want to be able to you the function from with in it.

Example: In the dll there will be a function call GetMountPoint()

in my VBScript I want to do:
Set oMydll = CreateObject("MyDll")
oMydll.GetMountPoint()

How can I do this.
Thanks in advance.
Nov 17 '05 #1
2 1360
"The Truth" <sh********@email.msn.R.E.M.O.V.E.T.H.I.S.com.no.s pam> wrote in
message news:u8**************@tk2msftngp13.phx.gbl...
I would like to write a DLL with a few function that are not available in
WMI. I know how to write a dll but is there anything special that I must
add to it if I want to be able to you the function from with in it.

Example: In the dll there will be a function call GetMountPoint()

in my VBScript I want to do:
Set oMydll = CreateObject("MyDll")
oMydll.GetMountPoint()


Your DLL won't be a garden variety DLL. It will be a DLL which contains a
COM object that implements the IDispatch (Automation) interface. That
interface will contain a method named GetMountPoint().

If the machines on which you plan to run this script have .Net installed
then you may be able to build a .Net component instead and use .Net's RegAsm
utility to register the assembly to be used by COM. It may be that that's
enough COM to satisfy VBScript but I'm not sure about that.

Regards,
Will


Nov 17 '05 #2
Jon
Could be done within Visual Basic by using the "Declare" function to declare
your dll, and exporting the appropriate function when creating your dll
(using a .def file).

VBScript, however, lacks the Declare statement.

If you want to do it using VBScript alone, you'd need to create a COM
component.

[ eg using File > New > ATL COM Wizard (& then Insert > New ATL Object >
"Simple Object " and then adding methods / properties ((VC++ 6))) ]

Jon

"The Truth" <sh********@email.msn.R.E.M.O.V.E.T.H.I.S.com.no.s pam> wrote in
message news:u8**************@tk2msftngp13.phx.gbl...
All,

I would like to write a DLL with a few function that are not available in
WMI. I know how to write a dll but is there anything special that I must
add to it if I want to be able to you the function from with in it.

Example: In the dll there will be a function call GetMountPoint()

in my VBScript I want to do:
Set oMydll = CreateObject("MyDll")
oMydll.GetMountPoint()

How can I do this.
Thanks in advance.

Nov 17 '05 #3

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

Similar topics

5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
29
by: Christopher Brandsdal | last post by:
If I have a .ASP page that runs JScript code - is it possible to include an ..ASP page that runs VBscript???
20
by: Harag | last post by:
Hi All. I'm stating out doing some web developing. I was wondering which of the server side languages should I concentrate on and learn. I Know CSS, HTML, T-SQL I can look at the client...
16
by: Mike Schinkel | last post by:
Does anyone know if there are bugs in VBScript's GetRef()? I'm using VBScript Version 5.6.8515 on Win2003Server w/ASP. Sometimes it returns an object that VarType() says is a vbObject. Other...
5
by: gpence | last post by:
!!! Newbie question warning !!! I am somewhat familiar with javascript's ability to "access" the browser's favorites list -- for example, using window.home() will take you to the default URL --...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
2
by: Frank | last post by:
Can I do this? I add a session var in C# and ultimatly want to pass it into a vbscript client side activeX control. This is what I have so far but get " Object Required:'name2' " error. Can...
7
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
10
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
6
by: rishabhshrivastava | last post by:
Hello All, I am using ASP.NET 2.0 and I am experiencing a problem using vbscript that is this script on client side is preventing the postback of my controls. I have a dropdownlist which is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.