API development environments
Due to the capabilities of the CatTools API, specifically that it can directly modify device data in the CatTools database, it is assumed that:
- Users accessing the CatTools API have a reasonable knowledge of Visual Basic programming skills and are familiar with the Visual Basic development environment, such as Visual Studio.
- Alternatively, users know how to utilize the VBA programming environment within Microsoft Office applications.
The API sample code is written in the VB/VBA programming language.
Within development environments, you can add a reference to the CatTools API called "CatTools API" to expose the classes available. Once this reference has been added, copy and paste the sample code from the CatTools API help pages into your VB project to execute the code.
Text editors
If you are using a text editor, such as Notepad, you cannot add a reference to the CatTools API. For text editors, you must change the code to use the CreateObject
function to reference the CatToolsAPI available classes. For example:
Dim DB Set DB = CreateObject("CatToolsAPI.Database")
This would be used to replace the lines in the sample code:
Dim DB As CatToolsAPI.Database Set DB = New CatToolsAPI.Database
Save the text file as a VBScript .vbs
file and run it.
Register the CatTools API library
In order for the API code to work, the CatTools API library file - Cattools.dll
- must be registered on the system correctly:
- From the Windows Explorer, navigate to Start and open the Run dialog.
- Open the
cattools.dll
:regsvr32 "C:\Windows\system32\cattools.dll"
Adding a reference within a VB editor
To add a reference using the Visual Basic editor within Microsoft Office applications:
- Go to Tools > References.
- Select CatTools API from the available references.
To add a reference using the Visual Basic 6 IDE application:
- Go to Project > References.
- Select the CatTools API from the available references.