Microsoft Visual C++

The SocketTools Library Edition includes import libraries, header files and class wrappers which can be used with Microsoft Visual C++ 6.0 and later. If you are using Visual C++ 6.0, it is required that you install Service Pack 6 (SP6). If you are using Visual C++ 7.1, which is part of Visual Studio .NET 2003, it is recommended that you install Service Pack 1 (SP1).

To build an application using SocketTools with Visual C++, the first step is to make sure the compiler is configured correctly to specify the correct paths to the directories where the header files and import libraries are found. In Visual C++, this is done by selecting Tools | Options from the menu, and then selecting the Directories tab. In Visual Studio.NET, this is done by selecting Tools | Options from the menu, then selecting the Projects folder and the VC++ Directories properties page. The path for the include files should be the Include folder, and the path for the library files should be the Lib folder, found where you installed SocketTools. For example, C:\Program Files\Catalyst\SocketTools Library Edition\Include would be the default path for the Library Edition include files.

If you are programming in C or C++, you must include the header file cstools6.h in your program. This file contains all of the macro, type, structure and function prototype definitions used by the SocketTools libraries. This will also automatically include two other header files which are used by SocketTools. The cserror6.h header file defines all the error codes, and the csrtkey6.h header defines the runtime license key which is used to initialize the SocketTools libraries.

A collection of classes which encapsulate the SocketTools API are also included as part of the standard header file. The SocketTools classes can be used with or without the Microsoft Foundation Classes (MFC), although certain functions are only available if MFC is used. The classes themselves are designed to be basic wrappers around the API and it is expected that most developers will use them as the base class for their own classes.

For Visual C++ programmers, there are special macros which are used in the cstools6.h header file that controls certain behavior:

CSTOOLS_NO_LIBRARIES
Visual C++ supports a pragma which can be used to automatically specify the names of libraries that the compiler should attempt to link with in order to resolve function calls. By default, it is not necessary to explicitly specify the names of the SocketTools import libraries to link to. However, if you wish to explicitly link to specific import libraries, then define this macro prior to including the cstools6.h header file.

CSTOOLS_NO_NAMESPACE
When compiling a C++ application, the SocketTools functions are defined in a namespace called SocketTools. This prevents the possibility of conflicts with functions of the same name that may be used in other libraries. If you prefer the functions to be defined in the global namespace instead, then define this macro prior to including the cstools6.h header file.

CSTOOLS_NO_CLASSES
When compiling a C++ application, class wrappers for the SocketTools API are normally included with the function prototypes. Defining this macro prevents the C++ classes from being defined, limiting the application to using only the standard functions.

These macros are not normally defined, and in most cases they will not be needed. Please note that if for some reason you modify the header files directly, you should copy the changes to another file using a different name. Otherwise, when you install an update to the product, the cstools6.h and cserror6.h header files will be replaced and you will lose your modifications.


Copyright © 2008 Catalyst Development Corporation. All rights reserved.