In .NET languages, you must add a reference to the Eth32.dll assembly. In the Visual Studio C# and VB.NET environments, this can be done by following these steps:
On the Project menu, select "Add Reference".
Click the Browse button. Find the Eth32.dll file from the ETH32 API distribution. The default installation directory for this file is C:\Program Files\winford\eth32\api\windows\ms.net. This file is also on the CD in the api\windows\ms.net directory.
Note that adding the reference causes Visual Studio to automatically copy the Eth32.dll file into your project directory.
In Managed C++, you must first manually copy the Eth32.dll file from the ETH32 API distribution (default location is C:\Program Files\winford\eth32\api\windows\ms.net) into your project directory (typically the same directory your source code files for that project are in). Then, you must include this line near the top of your managed C++ source file:
#using <Eth32.dll>
At this point, you have provided the compiler with enough information to successfully compile your application. In order to allow your application to run after compiling it, you also must place a copy of the Eth32.dll file into the subdirectory of your project where your executable is built, typically the Debug or Release directory. Those directories may not yet exist if you have not yet compiled your project.
Although not required, you will most likely want to add a line to your source file to use the WinfordEthIO namespace, which contains all of the classes and definitions in the Eth32.dll assembly. This line should go near the top of your source file, and varies depending on language:
Visual C#.NET
using WinfordEthIO;
Visual Basic.NET
Imports WinfordEthIO
Visual C++.NET (Managed)
using namespace WinfordEthIO;
If you decide not to include a namespace line, you will need to prepend WinfordEthIO before class names or other definitions you use from the assembly. Example code provided in this documentation assumes that the namespace line is used.
The main class provided by the assembly is the Eth32 class. Once an instance of this class has been created, you can begin using the members of this class, starting with Connect to create a connection. The basic code is typically as follows (substituting any valid variable name for dev and the actual address or DNS name of your device for 192.168.1.100):
Visual C#.NET
Eth32 dev = new Eth32(); dev.Connect("192.168.1.100");
Visual Basic.NET
Dim dev As New Eth32() dev.Connect("192.168.1.100")
Visual C++.NET (Managed)
Eth32 *eth = new Eth32; eth->Connect("192.168.1.100");