BOOK_CONTENT
From Learning MicroStation VBA

We added references to things such as the "Microsoft Scripting Runtime," "Microsoft ActiveX Data Objects," "Microsoft CDO for Windows 2000" and so forth. When we did this, we had instant access to functionality not natively exposed to VBA.

Although working with the Windows API is not as simple and straight forward as adding a reference, the process is fairly painless and the results can be powerful.

Declaring API Calls

You can declare Windows API calls in the General Declarations area of a code module. Once declared, use the API calls as you would use any other function or procedure.

Here is an example:

Public Declare Function <b class="bold">Beep</b> Lib "kernel32" (ByVal dwFreq As Long, _                                 ByVal dwDuration As Long) As Long

The function name in the above declaration is "Beep." It is an amazing API call that beeps. It beeps as long and as high (or as low) as we ask it to. You find API functions and procedures inside DLL (Dynamic Link Library) files. This one is inside the kernel32.dll file. Let's try it out, shall we?

After declaring the Beep function in the General Declarations area of a code module, we can use it as follows:

Sub <b class="bold">TestBeep</b>()    Beep 4000, 250    Beep 2000, 250    Beep 1000,...
Copyright Bentley Systems, Incorporated. 2006 under license agreement with Books24x7

Products & Services
Device Drivers
Device drivers are programs that provide the interface between general use software (such as an operating system) and specific hardware or software modules. With personal computers (PCs), drivers are often packaged as dynamic link library (DLL) files.
Voice Loggers and Audio Recorders
Audio recorders / voice loggers are used to locate, retrieve, duplicate and/or distribute audio voice or data information from single system environments to large multi-channel networked systems.
Automated Voice Answering Systems
Automated voice answering systems are used to take messages and to provide automated information retrieval requests.
Embedded Programming Software
Embedded programming software is used to program special-purpose computer systems that are designed to perform one or several dedicated functions.
Bus Analysis Software
Bus analysis software is used to analyze, manage, and interpret data from one or more computer buses.

Topics of Interest

We all know there is no reason to keep reinventing the wheel. Using existing resources speeds the development process and can result in a more bug-free application. Using ActiveX Controls ActiveX...

One ways to increase your speed in developing applications is to use of existing code, objects, and interfaces. Declaring MicroStation User Form Functions Access MicroStation's built-in User Form...

A.2 Declarations A.2.1 Declaration types A.2.1.1 Module parameter declarations local_parameter_declaration ::=<b class="bold"> localparam</b> data_type_or_implicit...

The description of a module in a digital system can be divided into two facets: the external view and the internal view. The external view describes the interface to the module, including the number...

The description of a module in a digital system can be divided into two facets: the external view and the internal view. The external view describes the interface to the module, including the number...

Product Announcements
CST - Computer Simulation Technology
CST - Computer Simulation Technology
CST - Computer Simulation Technology