Part I add within the reference lines, everything else is the wizard generated, attachment there is a call of library,
https://pan.baidu.com/s/1UB1dOh4fZ0rMauP63avGcA
//MFC - PLC21Dlg. CPP: implementation file
//
# include "stdafx. H"
MFC - PLC21. # include "h"
MFC - PLC21Dlg. # include "h"
# include "afxdialogex. H"
# ifdef _DEBUG
# define new DEBUG_NEW
# endif
/////////////////////////////////////////////////////////////////
HINSTANCE hinstDLL;
Typedef int (_stdcall * pOpen) (int nport, int BaudRate, int DataBits, char * Parity, int StopBits, char * User);
Typedef int (_stdcall * pClose) (int nport);
Typedef int (_stdcall * pSetDelay) (int value);
Typedef int (_stdcall * pComTrue) (int nport);
Typedef int (_stdcall * pComWork) (int nport);
Typedef int (_stdcall * pReadBit) (int nport, int the node, element, char * int address, int Bit);
Typedef int (_stdcall * pReadByte) (int nport, int the node, element, char * int address, int Count, int * RxdBuffer);
Typedef int (_stdcall * pReadInt) (int nport, int the node, element, char * int address, int Count, int * RxdBuffer);
Typedef int (_stdcall * pReadDInt) (int nport, int the node, element, char * int address, int Count, int * RxdBuffer);
Typedef int (_stdcall * pReadFloat) (int nport, int the node, element, char * int address, int Count, float * RxdBuffer);
Typedef int (_stdcall * pBitWrite) (int nport, int the node, element, char * int address, int Bit, int value);
Typedef int (_stdcall * pBitEWrite) (int nport, int the node, element, char * int address, int Bit, int value);
Typedef int (_stdcall * pEbitCancel) (int nport, int the node, element, char * int address, int Bit);
Typedef int (_stdcall * pWriteByte) (int nport, int the node, element, char * int address, int Count, int * TxdBuffer);
Typedef int (_stdcall * pWriteInt) (int nport, int the node, element, char * int address, int Count, int * TxdBuffer);
Typedef int (_stdcall * pWriteDInt) (int nport, int the node, element, char * int address, int Count, int * TxdBuffer);
Typedef int (_stdcall * pWriteFloat) (int nport, int the node, element, char * int address, int Count, float * TxdBuffer);
Typedef int (_stdcall * pPlcRun) (int nport, int node);
Typedef int (_stdcall * pPlcStop) (int nport, int node);
Typedef int (_stdcall * pBitBin) (int value, int Bitaddress);
Typedef int (_stdcall * p16I_8h) (int value);
Typedef int (_stdcall * p16I_8l) (int value);
Typedef int (_stdcall * p8I_16I) (int valueH, int valueL);
Typedef int (_stdcall * p32I_16h) (int value);
Typedef int (_stdcall * p32I_16l) (int value);
Typedef int (_stdcall * p16I_32I) (int valueH, int valueL);
Typedef int (_stdcall * p32f_16h) (float value);
Typedef int (_stdcall * p32f_16l) (float value);
Typedef float (_stdcall * p16I_32f) (int valueH, int valueL);
POpen mOpen;
The pClose mClose;
PSetDelay mSetDelay;
PComTrue mComTrue;
PComWork mComWork;
PReadBit mReadBit;
PReadByte mReadByte;
PReadInt mReadInt;
PReadDInt mReadDInt;
PReadFloat mReadFloat;
PBitWrite mBitWrite;
PBitEWrite mBitEWrite;
PEbitCancel mEbitCancel;
PWriteByte mWriteByte;
PWriteInt mWriteInt;
PWriteDInt mWriteDInt;
PWriteFloat mWriteFloat;
PPlcRun mPlcRun;
PPlcStop mPlcStop;
PBitBin mBitBin;
P16I_8h m16I_8h;
P16I_8l m16I_8l;
P8I_16I m8I_16I;
P32I_16h m32I_16h;
P32I_16l m32I_16l;
P16I_32I m16I_32I;
P32f_16h m32f_16h;
P32f_16l m32f_16l;
P16I_32f m16I_32f;
///////////////////////////////////////////////////////////////
//for application "about" menu item CAboutDlg dialog
The class CAboutDlg: public CDialogEx
{
Public:
CAboutDlg ();
//data dialog
# ifdef AFX_DESIGN_TIME
Enum {IDD=IDD_ABOUTBOX};
# endif
Protected:
Virtual void DoDataExchange (CDataExchange * symbol;//support DDX/DDV
//implementation
Protected:
DECLARE_MESSAGE_MAP ()
};
CAboutDlg: : CAboutDlg () : CDialogEx (IDD_ABOUTBOX)
{
}
Void CAboutDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
}
BEGIN_MESSAGE_MAP (CAboutDlg CDialogEx)
END_MESSAGE_MAP ()
//CMFCPLC21Dlg dialog
CMFCPLC21Dlg: : CMFCPLC21Dlg (pParent/*=NULL CWnd * */)
: CDialogEx (IDD_MFCPLC21_DIALOG, pParent)
{
M_hIcon=AfxGetApp () - & gt; LoadIcon (IDR_MAINFRAME);
}
Void CMFCPLC21Dlg: : DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
}
BEGIN_MESSAGE_MAP (CMFCPLC21Dlg CDialogEx)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull