API Access from C#
To start off, lets look at a simple C# console application which controls Microwave Office. For this example we'll use Visual Studio as the development environment.
Inside Visual Studio create a new solution, and from the C# options we select C# Console Application.
Next to access the object model for the API we need to add a reference to the API type library.
The type library provides information about all the objects exposed by the API to the development environment.
In the Solution Explorer window right click on the References tree item and select "Add Reference…"
In the Add Reference Dialog select the "COM" tab.
In the list box find an entry that starts with "AWR Design Environment <year>" highlight that entry and click 'Select'.
The entry will appear in the lower list box labeled "Selected Components", see Figure 6 below.
Now Click OK and the reference will be added to the list of references in the solution explorer tree, see Figure 7 below .
The Add Reference dialog allows you to set references to a number of components by selecting each adding the reference and then approving all the components at the end. So first locate the 'AWR Design Environment <year>' entry under the Component Name in the upper list box. Select the line and press the Select key. The highlighted component will then be moved to the lower list of selected components.
Once the OK button is pressed the MWOffice reference should appear in the list of references in the solution explorer.
Now open the main C# code file for the project and locate the Main function in the console class, it should look something like this: