資源簡介
用C++編寫的基于TCP/IP的Modbus網絡通訊工具源碼,據參考價值。
代碼片段和文件信息
//?Client.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Client.h“
#include?“ClientDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CClientApp
BEGIN_MESSAGE_MAP(CClientApp?CWinApp)
//{{AFX_MSG_MAP(CClientApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CClientApp?construction
CClientApp::CClientApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CClientApp?object
CClientApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CClientApp?initialization
BOOL?CClientApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
//初始化套接字
WSADATA?wsd;
AfxSocketInit(&wsd);
CClientDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????41004??2013-03-18?19:11??demo0313\Client.aps
?????文件???????1519??2009-03-07?13:06??demo0313\Client.clw
?????文件???????2118??2007-05-08?08:52??demo0313\Client.cpp
?????文件???????4360??2007-05-08?08:52??demo0313\Client.dsp
?????文件????????535??2007-05-08?08:52??demo0313\Client.dsw
?????文件???????1324??2007-05-08?08:52??demo0313\Client.h
?????文件??????48640??2009-03-07?13:06??demo0313\Client.opt
?????文件???????8667??2013-03-18?19:11??demo0313\Client.rc
?????文件????????878??2013-03-17?19:04??demo0313\Client.sln
????..A..H.?????18944??2013-03-19?20:24??demo0313\Client.suo
?????文件???????8013??2013-03-19?18:11??demo0313\Client.vcxproj
?????文件???????2093??2013-03-17?20:05??demo0313\Client.vcxproj.filters
?????文件????????143??2013-03-17?13:55??demo0313\Client.vcxproj.user
?????文件???????8831??2013-03-19?19:41??demo0313\ClientDlg.cpp
?????文件???????1892??2013-03-18?19:47??demo0313\ClientDlg.h
?????文件???????3378??2013-03-19?19:41??demo0313\Debug\cl.command.1.tlog
?????文件?????119478??2013-03-19?19:41??demo0313\Debug\CL.read.1.tlog
?????文件???????2434??2013-03-19?19:41??demo0313\Debug\CL.write.1.tlog
?????文件??????82432??2013-03-19?19:41??demo0313\Debug\Client.exe
?????文件????????667??2013-03-19?18:11??demo0313\Debug\Client.exe.em
?????文件?????????68??2013-03-19?18:11??demo0313\Debug\Client.exe.em
?????文件????????381??2013-03-19?19:41??demo0313\Debug\Client.exe.intermediate.manifest
?????文件????1669924??2013-03-19?19:41??demo0313\Debug\Client.ilk
?????文件?????????86??2013-03-19?19:41??demo0313\Debug\Client.lastbuildstate
?????文件???????2461??2013-03-19?19:41??demo0313\Debug\Client.log
?????文件?????132772??2013-03-19?18:11??demo0313\Debug\Client.obj
?????文件???20381696??2013-03-19?18:11??demo0313\Debug\Client.pch
?????文件????4033536??2013-03-19?19:41??demo0313\Debug\Client.pdb
?????文件???????3880??2013-03-19?18:11??demo0313\Debug\Client.res
?????文件?????168290??2013-03-19?19:41??demo0313\Debug\ClientDlg.obj
............此處省略58個文件信息
評論
共有 條評論