BNC 1201 - 6 1/2 Digit Digital Multimeter User Manual

Page 164

Advertising
background image

165

Visual C++

In an MFC application, you can override BERKELEY NUCLEONICS

CORPORATION IOUtils interfaces in a class as well as provide additional

interfaces. The example in this article illustrates how to override an

interface in a class while preserving the original interface implementation

so that it can be delegated to by the new interface implementation.

Browse the Visual C++ samples code; see Visual C++ DEVQUERY

Sample Application.

Using MEASure? for a Single Measurement

The following example uses the MEASure? command to make a single ac

current measurement. This is the easiest way to program the multimeter

for measurements. However, MEASure? does not offer much flexibility.

The example is shown in Visual Basic.

Creating the Application

Create a new Visual Basic project as follows:

1. Create a new Standar.EXE project.

2. To set the startup object for a Windows Application to Sub Main

3. Add New Module, and declare a Sub Main().

How to: Change the Startup Object for an Application

The Startup Object property for a project defines the entry point to be

called when the application loads; generally this is set to either the main

form in your application or to the Sub Main procedure that should run

when the application starts. Since Class Libraries do not have an entry

point, their only option for this property is (None).

For Windows Applications projects, only forms or classes with a Public

Sub Main procedure are available as Startup objects unless you check

the Startup with custom Sub Main checkbox; when this option is checked,

you must add code in the Sub Main procedure for the form.

※ Note:

When using a custom Sub Main procedure as the Startup object,

code in the Application events (Startup, Shutdown, Startup Next

Advertising