DLL

 

Description

The DLL function allows you to access the global properties and methods of the WshDialog DLL, like version information, registered path and logging mode

Syntax

[Set oApp =] oDlg.DLL

Parameters

Part

Description

Set oApp =

(optional) Store a reference to the application in the variable oApp. This variable can be used to access the applications's properties and methods

oDlg

A reference to the WshDialog.Kit automation object (as returned by the
WScript or VBScript CreateObject methods)

Properties and Methods

Property

Description

Comments

(read-only) Returns comments included at design time

CompanyName

(read-only) Returns the company name or creator of the DLL

EXEName

(read-only) Returns the root name of the executable (without extension)

FileDescription

(read-only) Returns file description information

LegalCopyright

(read-only) Returns legal copyright information

LegalTrademarkst

(read-only) Returns legal trademark information

LogMode

(read-only) Returns the logmode set with the StartLogging method.
The default is 1, which means that logging is turned off

LogPath

(read-only) Returns the path and filename of the file used to capture output from the LogEvent method. Can be set with StartLogging

Major

(read-only) Returns the major release number

Minor

(read-only) Returns the minor release number

NonModalAllowed

(read-only) Returns False to indicate that forms can't be shown modeless

Path

(read-only) Returns the path of the registered WshDialog automation object

ProductName

(read-only) Returns the product name

Revision

(read-only) Returns the revison version number

Method

Description

LogEvent

Logs an event in the application's log target. On Windows NT platforms, the method writes to the NT Event log. On Windows9x platforms, the method writes to the file specified in the LogPath property. By default, if no file is specified, events will be written to %windir%\vbevents.log.
Guidelines for logging are available in the Win32 SDK

Parameters: LogBuffer, EventType

LogBuffer

String to be written to the log

EventType

A long integer that specifies the type of event

1

Error

2

Warning

4

Information

StartLogging

Sets the log target and log mode of an operation

Parameters: LogTarget, LogMode

LogTarget

Path and filename used to capture output from LogEvent

LogMode

Determines how logging by LogEvent will be carried out

0

If running on Windows9x, logs messages to the file specified in the LogPath property. If running on Windows NT, messages are logged to the Windows NT Event Log, with "VBRunTime" used as the application source and App.Title appearing in the description

1

Turns all logging off

2

Forces logging to a file. If no valid filename is present in LogPath, logging is ignored, and the property is set to 1

3

Forces logging to the NT event log. If not running on Windows NT, or the event log is unavailable, logging is ignored and the property is set to 1 (off)

16

Indicates that the logfile should be recreated each time the application starts. This value can be combined with other mode options using the OR operator. The default action for logging is to append to the existing file. In the case of NT event logging, this flag has no meaning

32

Indicates that the current thread ID be prepended to the message, in the form "[T:0nnn] ". This value can be combined with other mode options using the OR operator. The default action is to show the thread ID only when the application is multi-threaded (either explicitly marked as thread-safe, or implemented as an implicit multithreaded app, such as a local server with the instancing property set to Single-Use, multithreaded)

Example

Option Explicit

Dim oDlg

'Create the WshDialog.Kit object and store a reference in oDlg
Set oDlg = Wscript.CreateObject("WshDialog.Kit", "oDlg_")

'Show the version information included in the WshDialog.DLL
MsgBox "Version " & oDlg.DLL.Major & "." & oDlg.DLL.Minor & "." & oDlg.DLL.Revision