Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2004

Tip: Looking for answers? Try searching our database.

DLL and VBScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
The Truth - 23 Jul 2004 03:51 GMT
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.
William DePalo [MVP VC++] - 23 Jul 2004 04:32 GMT
> 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
[quoted text clipped - 5 lines]
> 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
Jon - 23 Jul 2004 11:55 GMT
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

> All,
>
[quoted text clipped - 10 lines]
> How can I do this.
> Thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.