Installing C++ source files
When extracting the source files keep the directory structure for correct compilation.
Load the workspace Modbucfg.dsw, this workspace contain 3 projects , Modbucfg (Modbus configuration utility) , Modbulib (A library containing the modbus classes and some other classes) and ModbusServer (ActiveX server ).
Before trying to compile you need to change some options of Visual C++ :
Suppose you extract the file to a directory called c:\Modbus then
a) Add the directory "C:\Modbus\UtilClasses\include" to Tool | directory | Include Files
b) Add the directory "C:\Modbus\ModbuLib" to Tool | directory | Library Files
Now you can build the projects. Try first the debug version following the steps below:
When you desire to add the Modbus classes to your MFC project is necessary add a line
to stdafx.h file. This header file include some MFC and ATL header files used by modbus classes.
and add the line
to stdafx.cpp. This is needed to use some ATL classes.
Include the header files of the class you are interested, for instance LocalModbus.h, and use MFC as shared DLL.
These includes add MFC and ATL classes to your project.
CModbus class, Home