Specifications
24/201
6.3 Using Visual C++
6.3.1 Preparation
To create a transmission application, the following systems must be installed in the personal computer
in advance.
③ Microsoft Windows95/98/NT4.0/2000/XP
*1
④ Visual C++ Ver5.0 or more
*2
*1 MS Windows 95/98/NT4.0/2000/XP is a registered trademark of Microsoft Corporation, U.S.A.
*2 Visual C++ is a registered trademark of, Microsoft Corporation U.S.A.
6.3.2 How to Create a transmission application
This paragraph explains a simple program, as an example, which sends/receives a job that was input to
the text box to/from the controller.
6.3.2.1 Creation of Skelton
Create a skelton using Visual C++ Ver.5.0 with the following procedure.
① Start up the Microsoft Development Studio and select “New” from the “File” menu to display
the “New” display. Then click “Project Work Space” and then the [OK] button.
② Select the “Project” tab and then “MFC AppWizard (exe).”
③ Enter the project name (in this example, input Test), and specify the folder where the project is
to be created. Then click the [OK] button.
④ Select “dialog base” as the type of the application to be created in “step 1,” and click the
[EXIT] button.
A source code to display a dialog box where only [OK] and [CANCEL] pushbuttons exist is
created.
6.3.2.2 Definition of DLL Call
① Include “motocom.h” attached to the MOTOCOM32 application using the dialog class source file
(TestDig.cpp). Also include the header file, “direct.h,” as the sample source as shown below.
#include "stdafx.h"
#include "Test.h"
#include "TestDlg.h"
#include <direct.h> <------Add this line.
#include "motocom.h" <------Add this line.
② Copy the “motocom32.lib” file, the “motocom.h” file and the data transmission function (Windows
DLL file type, file name: Motocom32.DLL and Motolk.DLL, Motolkr.Dll
) to the directory where
the project exists.
③ Click the “Build” and then the “Setting” buttons, and open the “link” tab in the “Set Project” dialog
box. Specify the “motocom32.lib” file in the “Object/Library Module” setting column, and click
the [OK] button.
The MOTOCOM32 functions can be used in the file where “motocom.h” is included.
Note: The library file (file name: Motocom32.Lib) and the included file (file name: Motocom.h) are in
the MOTOCOM32 installation directory.
6.3.2.3 Editing with a Dialog Box
Edit the following with the created dialog box. Open the IDD_TEST_DIALOG dialog box.
① Delete the [CANCEL] pushbutton which was created by default.
② Change the caption of the [OK] pushbutton to “Exit.”