Create Project
Launch Visual Studio, select [New]-[Project] from [File] menu.
From the template of [Create a new project] dialog box, select [Windows Forms App] of [C#], click the [Next] button.
From the [Configure your new project] dialog box, specify the project name and the location of the project to be created, click the [Next] button.
From the [Additional information] dialog box, select [.NET 8.0(Long Term Support)], and click the [Create] button, then the project will be created.
* The above is for Microsoft Visual Studio Professional 2022 (64-bit). 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 C#.
Place CWaveFormGenerator.tlb in the same directory as the project.
Select Project -> Add Project 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.
Select "Dependencies" -> "COM" -> "Interop.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 "No".
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 partial class Form1 : Form
{
ICWaveformGenerator c_fgen;
private void Form1_Load(object sender, EventArgs e)
{
c_fgen = new CCWaveformGeneratorClass();
}
......
......
......