![]() |
|
|
|
|
1
6th August 00:11
External User
Posts: 1
|
I've just figured out how to create and use WSH objects in VB 5 PRO. I
(http://www.savefile.com/projects/808766665) I guess I'm wondering what files does the end user need to have in order to use it? I'm also wondering where did I get the type library? Was it installed by one of my many companion CDs, or does it come with VB 5? I don't have a lot of experience using type libraries. I actually prefer to write programs that don't require additional files, registering of activex controls, etc. Less headaches. |
|
|
|
|
2
6th August 00:11
External User
Posts: 1
|
WScript comes with Windows, unless your customers are running older versions
such as Windows 95/98 you can normally rely on version 5.6 being present. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name |
|
|
|
|
3
6th August 00:11
External User
Posts: 1
|
WSH is included with Internet Explorer 6.0 or later and thus with any
Windows version that includes Internet Explorer 6.0 or later. The type library for every component that has one (from almost any vendor) is installed as part of that software and listed in the registry. So when the end user installs Windows, Internet Explorer, Media Player, Office, or any other product that has a scriptable object, that type library is also installed, no extra installation step needed. Windows itself also contains interfaces for listing the available type libraries and the functions / objects they provide. If you have the Microsoft Platform SDK or Visual Studio, the tool "OLE/COM object viewer" will show you all the interfaces and type libraries on a computer, but this is just a help lookup tool, it is not needed to actually use those interfaces. In the type library view of the OLE/COM object viewer, it is the "dispinterfaces" that can be used from scripts, while the "ISomething" interfaces can be used from C++ programs. -- Jakob Bøhm, M.Sc.Eng. * jb@danware.dk * direct tel:+45-45-90-25-33 Netop Solutions A/S * Bregnerodvej 127 * DK-3460 Birkerod * DENMARK http://www.netop.com * tel:+45-45-90-25-25 * fax:+45-45-90-25-26 Information in this mail is hasty, not binding and may not be right. Information in this posting may not be the official position of Netop Solutions A/S, only the personal opinions of the author. |
|
|
4
6th August 00:11
External User
Posts: 1
|
My recollection is that if I want to use early binding with the
Scripting.Dictionary or Scripting.FileSystemObject objects in VB6 I must include a reference to "Microsoft Scripting Runtime", which is scrrun.dll. I also recall that VB5 did not support functions like StrReverse, InStrRev, Replace, Split, Join, and Round. I've used the Wscript.Network and Wscript.Shell objects in VB (late binding), but the Wscript object functions like Timer, Sleep, and Echo are not available. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
|
|
7
6th August 00:11
External User
Posts: 1
|
On May 22, 2:25 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
I, myself, still use 98. Yes, I'm a diehard. I'm actually not sure which Windows versions my scripting language will and won't run on. Unfortunately, I don't have the time or the resources to test it out (and my other programs) on every version of windows. I've given up on that. Would be a mammoth effort. ----------- VBScript will run on Win9x clients (Windows 95 and Windows 98) if either DSClient or WSH is installed. I assume either of these installs the scrrun.dll I mentioned earlier. VBScript (and scrrun.dll) comes with all Windows OS's after that, as far as I know. I still keep Win95 and Win98 clients for testing. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
|
|
9
6th August 00:11
External User
Posts: 1
|
VB is not VBScript, it is its own language, with its own (different)
versions of VB/VBScript builtin functions such as StrReverse, InStrRev etc. These functions are not accessed via a Type library in either language but are part of the language interpreter/compiler itself. Thus VB5, VB6, VBA, VBScript etc. each have their own definitions and implementations of these functions, even if running on the same computer with the same scripting runtime installed. When importing a type library into your program, the notation and convenience is different for VB and vbscript: In VB you specify the installed DLL which provides both the API and its type library, or you write endless lists of Declare and Const statements. In VBScript you either specify the Name (or GUID) of the type library in a .wsf file or write endless lists of Const statements. Here is an example of referencing the WScript runtime and one of the database APIs from a VBScript stored in .wsf format: <?xml version="1.0" encoding="iso8859-1" ?> <job id="myscriptname" args="mydefaultarg"> <?job error="false" debug="false" ?> <reference guid="{420B2830-E718-11CF-893D-00A0C9054228}" version="1.0"/> <reference guid="{EF53050B-882E-4776-B643-EDA472E8E3F2}" version="2.7"/> <script language="VBScript"> <![CDATA[ ' VBScript code goes here ]]> </script> </job> -- Jakob Bøhm, M.Sc.Eng. * jb@danware.dk * direct tel:+45-45-90-25-33 Netop Solutions A/S * Bregnerodvej 127 * DK-3460 Birkerod * DENMARK http://www.netop.com * tel:+45-45-90-25-25 * fax:+45-45-90-25-26 Information in this mail is hasty, not binding and may not be right. Information in this posting may not be the official position of Netop Solutions A/S, only the personal opinions of the author. |
|