-
大小: 103KB文件類型: .zip金幣: 2下載: 0 次發布日期: 2023-07-28
- 語言: 其他
- 標簽: CSerialPort??
資源簡介
本串口工具集成目前多數串口工具的優秀功能于一身,采用CSerialPort類進行編寫,并在此基礎上對該類進行了改進。本工具免費試用,永不過期。并且本著奉獻的精神,公開本串口工具的源代碼,希望廣大用戶反饋意見或建議。
源碼地址:code.csdn.net/itas109/serialport_itas109
博客地址:blog.csdn.net/itas109
Email:itas109@qq.com
本軟件主要在XP系統做測試使用。
本工具的主要功能有:
1.接收從串口進來的數據并在窗口顯示.
2.所接收到的數據數據顯示方式可以選擇為字符方式或者HEX方式
3.支持顯示中文
4.串口波特率可以選擇為300bps-115200bps.
5.可以即時刷新存在的串口號.如果您增加了usb轉串口等設備,點擊刷新串口按鈕后,新的串口號也會在列表中出現.
6.支持最多20個串口列表,包括COM1-COM256中的任意20個活躍串口
7.可以選擇“5、6、7、8”四種數據長度.
8.可以選擇為“1、2”兩種停止位.
9.數據可以選擇為“無、奇校驗、偶校驗、1、0”四種方式.
10.串口設置和字符串操作等設置在程序關閉時自動保存,打開時自動載入.您可以自行設置是否自動保存.
11.可以在字符串輸入框輸入您想發送的字符串,并發送.
12.可以在字符串輸入框輸入您想發送的HEX數據串,數據的值從00到FF,沒有任何限制.
13.可以定時重復發送數據,并可以設置發送時間間隔.
14.可以在發送字符串時選擇發送新行,即自動加上回車換行.
15.可以即時顯示發送的字節數和接收到的字節數,按清除窗口將會清零.
16、可以設置自動清空功能,在達到30行數據時,自動清空。未設置時,達到100行,自動清空.
17、在手動發送旁邊的按鈕可以設置按ENTER發送數據,注意點擊“打開串口”后,請使焦點離開該控件.
另外要說明的是,由于本人編程能力有效,未免可能有些差錯,在此先聲明一下,您可以免費使用和自由傳播本軟件,但是我不對本軟件所造成的任何損失負責!如果你使用了本軟件,即表明您愿意接收這一條款。如果你不能接受,請立即將其刪除!

代碼片段和文件信息
//Download?by?http://www.NewXing.com
//?COMTOOL.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“COMTOOL.h“
#include?“COMTOOLDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CCOMTOOLApp
BEGIN_MESSAGE_MAP(CCOMTOOLApp?CWinApp)
//{{AFX_MSG_MAP(CCOMTOOLApp)
//?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()
/////////////////////////////////////////////////////////////////////////////
//?CCOMTOOLApp?construction
CCOMTOOLApp::CCOMTOOLApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CCOMTOOLApp?object
CCOMTOOLApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CCOMTOOLApp?initialization
BOOL?CCOMTOOLApp::InitInstance()
{
AfxEnableControlContainer();
SetRegistryKey(“串口助手itas109“);///設置注冊表名稱
//?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
CCOMTOOLDlg?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;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-01-16?15:07??SerialPort\
?????文件???????44748??2014-01-16?10:34??SerialPort\COMTOOL.APS
?????文件????????3539??2014-01-16?12:25??SerialPort\COMTOOL.clw
?????文件????????2171??2014-01-14?14:26??SerialPort\COMTOOL.cpp
?????文件????????4713??2014-01-15?21:08??SerialPort\COMTOOL.dsp
?????文件?????????539??2005-05-25?09:16??SerialPort\COMTOOL.dsw
?????文件???????49152??2014-01-16?12:20??SerialPort\COMTOOL.exe
?????文件????????1373??2011-04-12?11:54??SerialPort\COMTOOL.h
?????文件??????164864??2014-01-16?12:26??SerialPort\COMTOOL.ncb
?????文件???????52736??2014-01-16?12:26??SerialPort\COMTOOL.opt
?????文件????????4765??2014-01-16?12:20??SerialPort\COMTOOL.plg
?????文件???????11760??2014-01-16?10:34??SerialPort\COMTOOL.rc
?????文件???????26481??2014-01-16?12:18??SerialPort\COMTOOLDlg.cpp
?????文件????????3590??2014-01-16?11:03??SerialPort\COMTOOLDlg.h
?????文件????????1022??2014-01-15?21:07??SerialPort\MyHelpDlg.cpp
?????文件????????1253??2014-01-15?21:07??SerialPort\MyHelpDlg.h
?????文件????????1639??2014-01-16?15:07??SerialPort\READ?ME.txt
?????文件????????3597??2005-05-25?09:16??SerialPort\ReadMe.txt
?????文件???????29121??2014-01-13?21:11??SerialPort\SerialPort.cpp
?????文件????????5281??2014-01-13?20:56??SerialPort\SerialPort.h
?????文件?????????247??2011-04-12?11:54??SerialPort\StdAfx.cpp
?????文件????????1092??2011-04-12?11:54??SerialPort\StdAfx.h
?????目錄???????????0??2014-01-16?12:43??SerialPort\res\
?????文件????????1078??2005-05-25?19:19??SerialPort\res\COMTOOL.ico
?????文件?????????399??2005-05-25?09:16??SerialPort\res\COMTOOL.rc2
?????文件????????1078??2014-01-09?12:49??SerialPort\res\ICON_NOT.ICO
?????文件????????1078??2014-01-09?12:49??SerialPort\res\ICON_ON.ICO
?????文件????????8192??2014-01-09?12:49??SerialPort\res\Thumbs.db
?????文件????????2475??2014-01-15?20:57??SerialPort\resource.h
評論
共有 條評論