Technical Document #5

Technical Document #5        [Product Version: 11.1.0 and below]
Using WinDriver to develop in Visual Basic

  • This document refers to development in Visual Basic 6.0.
    For information regarding WinDriver's support for Visual Basic .NET, refer to Technical Document #128.
  • Beginning with version 11.2.0 of WinDriver, Visual Basic 6.0 is no longer supported.

The entire WinDriver API can be used from within a Visual Basic (VB) 6.0 application. To enable this, WinDriver includes VB implementations of WinDriver APIs, found in the windrvr.bas and wd_utils.bas files (previously windrvr.cls and wd_utils.cls) in the WinDriver\vb\include directory; and the wdapi DLL — WinDriver\redist\wdapi<version>.dll (e.g., wdapi1200.dll — for v12.0.0 of WinDriver), which provides APIs that can be used from a VB application. (Note: This DLL was previously named wd_utils.dll and before that wd_vb.dll).

The wdapi DLL is implemented in C. For most of the APIs there is a single implementation that can be used from both a C and a VB application. However, some of the WinDriver functions, mainly those that are executed from a separate thread (e.g., InterruptEnable(), EventRegister(), WDU_Init()), require a specific implementation for VB. The VB prototypes of these functions usually contain an extra parameter — hWnd — that is designed to hold a handle to the form window related to the function call.

Beginning with version 6.0.0 of WinDriver, you can use DriverWizard to generate skeletal Visual Basic diagnostics code for your device.
WinDriver also includes Visual Basic samples (found in the WinDriver\vb\samples directory), which demonstrate how to use WinDriver's basic functions and structures from within a VB application.

NOTE: If you are using version 6.0.0 of WinDriver to develop a VB USB driver, refer to Technical Document #119 for a modified wd_utils.bas file for this version. (You can also use the modified file for PCI/ISA VB development, however the changes in the modified file are related specifically to the USB API.)