資源簡介
串口通信,打開COM1口,設置,然后發送數據,可以下載Configure Virtual Serial Port Driver,查看發送狀態。
代碼片段和文件信息
//?SCOMM.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“SCOMM.h“
#include?“SCOMMDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#endif
//?CSCOMMApp
BEGIN_MESSAGE_MAP(CSCOMMApp?CWinApp)
ON_COMMAND(ID_HELP?&CWinApp::onhelp)
END_MESSAGE_MAP()
//?CSCOMMApp?construction
CSCOMMApp::CSCOMMApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
//?The?one?and?only?CSCOMMApp?object
CSCOMMApp?theApp;
//?CSCOMMApp?initialization
BOOL?CSCOMMApp::InitInstance()
{
//?InitCommonControlsEx()?is?required?on?Windows?XP?if?an?application
//?manifest?specifies?use?of?ComCtl32.dll?version?6?or?later?to?enable
//?visual?styles.??Otherwise?any?window?creation?will?fail.
INITCOMMONCONTROLSEX?InitCtrls;
InitCtrls.dwSize?=?sizeof(InitCtrls);
//?Set?this?to?include?all?the?common?control?classes?you?want?to?use
//?in?your?application.
InitCtrls.dwICC?=?ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::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
//?Change?the?registry?key?under?which?our?settings?are?stored
//?TODO:?You?should?modify?this?string?to?be?something?appropriate
//?such?as?the?name?of?your?company?or?organization
SetRegistryKey(_T(“Local?AppWizard-Generated?Applications“));
CSCOMMDlg?dlg;
m_pMainWnd?=?&dlg;
INT_PTR?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;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-03-13?09:22??SCOMM\
?????目錄???????????0??2017-03-13?09:43??SCOMM\Debug\
?????文件??????135680??2017-03-13?09:46??SCOMM\Debug\SCOMM.exe
?????文件?????1197424??2017-03-13?09:46??SCOMM\Debug\SCOMM.ilk
?????文件?????3664896??2017-03-13?09:46??SCOMM\Debug\SCOMM.pdb
?????目錄???????????0??2017-03-13?09:46??SCOMM\SCOMM\
?????文件????18525184??2017-03-13?09:55??SCOMM\SCOMM.ncb
?????文件?????????881??2017-03-12?19:12??SCOMM\SCOMM.sln
?????文件???????27136??2017-03-13?09:55??SCOMM\SCOMM.suo
?????目錄???????????0??2017-03-13?09:46??SCOMM\SCOMM\Debug\
?????文件???????10146??2017-03-13?09:46??SCOMM\SCOMM\Debug\BuildLog.htm
?????文件??????????67??2017-03-13?09:46??SCOMM\SCOMM\Debug\mt.dep
?????文件????????1196??2017-03-13?09:43??SCOMM\SCOMM\Debug\SCOMM.exe.em
?????文件????????1260??2017-03-13?09:43??SCOMM\SCOMM\Debug\SCOMM.exe.em
?????文件????????1120??2017-03-13?09:46??SCOMM\SCOMM\Debug\SCOMM.exe.intermediate.manifest
?????文件???????22567??2017-03-13?09:46??SCOMM\SCOMM\Debug\SCOMM.obj
?????文件????25100288??2017-03-13?09:43??SCOMM\SCOMM\Debug\SCOMM.pch
?????文件???????23452??2017-03-13?09:43??SCOMM\SCOMM\Debug\SCOMM.res
?????文件???????52310??2017-03-13?09:46??SCOMM\SCOMM\Debug\SCOMMDlg.obj
?????文件???????38238??2017-03-13?09:46??SCOMM\SCOMM\Debug\SerialPort.obj
?????文件??????465834??2017-03-13?09:43??SCOMM\SCOMM\Debug\stdafx.obj
?????文件??????912384??2017-03-13?09:46??SCOMM\SCOMM\Debug\vc90.idb
?????文件?????2011136??2017-03-13?09:46??SCOMM\SCOMM\Debug\vc90.pdb
?????文件????????4206??2017-03-12?19:12??SCOMM\SCOMM\ReadMe.txt
?????目錄???????????0??2017-03-12?19:12??SCOMM\SCOMM\res\
?????文件?????????677??2017-03-12?19:17??SCOMM\SCOMM\resource.h
?????文件???????21630??2003-07-23?17:52??SCOMM\SCOMM\res\SCOMM.ico
?????文件?????????396??2017-03-12?19:12??SCOMM\SCOMM\res\SCOMM.rc2
?????文件???????58572??2017-03-12?19:17??SCOMM\SCOMM\SCOMM.APS
?????文件????????2071??2017-03-12?19:12??SCOMM\SCOMM\SCOMM.cpp
?????文件?????????532??2017-03-12?19:40??SCOMM\SCOMM\SCOMM.h
............此處省略10個文件信息
評論
共有 條評論