Writing a plugin : Creating a new plugin project

Creating a new plugin project
Starting a project in Visual Basic .NET
To start a plugin project in Visual Basic .NET:
1
2
To create a new project, select File > New > Project.
 
3
For a Visual Basic project type, select Class Library from the templates, enter a Name for your project, and then click OK.
4
To successfully interact with VWorks Plugin, you must tell the compiler to generate a type library (TLB) and register it with COM as follows:
a
Edit the properties for your project by selecting Project > projectname Properties.
b
Click the Compile tab, and then select the Register for COM interop check box.
c
5
a
Select Project > Add Reference.
b
Click the COM tab.
c
d
If you want to implement the IVHooks interface, select the VHooksInterface 1.0 Type Library (VHooksInterface.dll).
Note: If you do not see the type library on the list, click the Browse button and then navigate to the …\Agilent Technologies\VWorks folder.
e
6
Implements Interfacename.Interfacemember
Refer to the table in “Interfaces overview” for a list of VWorks Plugin interfaces. For all interfaces but IVHooks, use the IWorksDriver Namespace. For the IVHooks interface, use VHookInterfaceLib.
The following example shows the Implements statement for the IWorksDriver interface:
 
7
Press Enter.
Visual Studio automatically creates empty method bodies for each method defined in the interface.
8
Starting a project in C#
To start your project in C#:
1
2
To create a new file, select File > New > Project.
 
3
For a C# project type, select Class Library from the templates, enter a Name for your project, and then click OK.
4
To successfully interact with VWorks Plugin, you must tell the compiler to additionally generate a type library (TLB) and register it for COM interop as follows:
a
Edit the properties for your project by selecting Project > projectname Properties.
b
Click the Build tab, and then select the Register for COM interop check box.
c
Click the Application tab, and then click Assembly Information.
d
Select the Make assembly COM-Visible check box.
e
5
a
Select Project > Add Reference.
b
Click the COM tab.
c
d
If you want to implement the IVHooks interface, select the VHooksInterface 1.0 Type Library (VHooksInterface.dll).
Note: If you do not see the type library on the list, click the Browse button and then navigate to the …\Agilent Technologies\VWorks folder.
e
6
: Interfacename.Interfacemember
Right-click the Interfacemember and select Implement Interface > Implement Interface.
Visual Studio automatically creates empty method bodies for each method defined in the interface.
The following example shows the interface declaration for the IWorksDriver interface:
 
7
Loading your plugin into VWorks software
To load your plugin into VWorks software for testing:
1
Compile your plugin and copy the appropriate *.dll files into the …\Agilent Technologies\VWorks\Plugins folder as follows:
2
Now you can test your plugin using the IWorksTest utility and VWorks software. For more information about the IWorksTest utility, see “Testing and debugging” .
Related information
 
Testing your VWorks software plugin