Visual Basic .NET (.NET Framework)


Create Project

Launch Visual Studio, select [New]-[Project] from [File] menu.
From the [Templates] of [New Project] dialog box, select [Windows Form Application] of [Visual Basic],
and specify the name and location of the project to be created.
When click the [OK] button, the project will be created.

* Item names and commands may differ depending on the version of Visual Studio.

Import Type Library

The CWaveFormGenerator.tlb file is required to use the functions of the C-WaveformGenerator SDK driver in Visual Basic.

Place CWaveFormGenerator.tlb in the same directory as the project.

Select Project -> Add Reference to display the Reference Manager.


Select "COM" in the tree of the Reference Manager window, press the Browse button, select CWaveformGenerator.tlb in the same directory, and press OK.

 

Embed Interop Types

Select "References" -> "CWaveformGenerator" on Visual Studio's Solution Explorer to display the reference properties of Interop.CWaveformGenerator.

Set the "Embed Interop Types" item in the properties window to "False".

 

Create Class Instance

Declare a variable within your form class to use CWaveformGenerator.

Inside the subroutine, create a class instance of CWaveformGenerator.CCWaveformGeneratorClass.

The following is an example of the Form1 class, declaring the c_fgen variable and creating a class instance within the Form1_Load subroutine.

 

Public Class Form1

    Dim c_fgen

 

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        c_fgen = New CWaveformGenerator.CCWaveformGeneratorClass()

    End Sub

 

    ......

    ......

    ......

 

End Class