Overview
Compiling and registering
Features
Compatibility
Links and references
The .Net
folder contains C# examples for creating .dll
libraries that can be called from VBScript, extending the power of VBScript using the .NET Framework.
Among the options for building (compiling and registering) the class libraries are
- Run Setup.vbs in the project folder.
- Run
build.vbs
in the build folder. - Run one or more of the
.bat
scripts in the build folder from an elevated command prompt. - Drag one or more of the
.bat
scripts in the build folder ontobuild.vbs
. - Use Visual Studio (not tested).
Features include the following:
- Documentation.
- Manual tests that demonstrate functionality and usage.
- Automated integration tests.
- For an example of a COM event, or callback, see NotifyIcon.cs and NotifyIcon-test.vbs.
- For a progress bar proof of concept, see ProgressBar.cs and ProgressBar-test.vbs.
- For a simple example of making a C# method available to VBScript, see EventLogger.cs.
- For an example of a class requiring an assembly reference, and an illustration of how to do it, see SpeechSynthesis.cs, and SpeechSynthesis.rsp.
- For a user-friendly file chooser dialog, see FileChooser.cs.
- For a user-friendly folder chooser dialog, see FolderChooser.cs and FolderChooser2.cs. These two files are adapted from stackoverflow.com posts. The exposed features of the two are identical.
FolderChooser2
is a backup in caseFolderChooser.cs
breaks due to future changes in the private members that are invoked using Reflection.
Most thoroughly tested on Windows 10, the libraries are all expected to work on Windows versions as old as Vista, with the exception of SpeechSynthesis
, which requires a reference probably not available on most Vista machines.
Interoperability (C# Programming Guide)
Example COM Class
Exposing .NET components to COM
Calling back to VBScript from C#
Extracting an icon from a .dll file
Invoking the NotifyIcon context menu
Browse for a directory in C#
Show detailed browser from a property grid
Component Object Model (COM)