91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

在bcb6.0下用mscomm控件作的通訊程序,希望對需要的有所幫助

資源截圖

代碼片段和文件信息

//---------------------------------------------------------------------------

#include?
#pragma?hdrstop

#include?“shiyan15.h“
//---------------------------------------------------------------------------
#pragma?package(smart_init)
#pragma?link?“MSCommLib_OCX“
#pragma?link?“AniGIFCtrl_OCX“
#pragma?resource?“*.dfm“
TForm1?*Form1;
Byte?buff[1024];
int?buff_wp=0;
int?buff?rp=0;
//---------------------------------------------------------------------------
__fastcall?TForm1::TForm1(TComponent*?Owner)
????????:?TForm(Owner)
{
}
//---------------------------------------------------------------------------
void?__fastcall?TForm1::FormCreate(Tobject?*Sender)
{
????????MSComm1->InputLen=0;??????//?確定希望從接收緩沖區移出的字符數量,InputLen=0時一次把接收緩沖區的字符全部移出.
????????MSComm1->InBufferSize=256;
????????MSComm1->OutBufferSize=256;
????????MSComm1->SThreshold=0;?????//表示發送數據時不發生OnComm事件
????????MSComm1->RThreshold=1;?????????//設定當接收9個字符時觸發OnComm事件
????????MSComm1->InputMode=comInputModeBinary;
????????MSComm1->InBufferCount=0;
????????MSComm1->OutBufferCount=0;
????????MSComm1->DTREnable=true;
????????MSComm1->RTSEnable=true;

????????Shape1->Brush->Color=clYellow;
????????BtnOpen->Enabled?=?true;
????????BtnClose->Enabled?=?false;
????????Memo1->Clear();
????????Memo2->Clear();


}
//---------------------------------------------------------------------------
void?__fastcall?TForm1::Button3Click(Tobject?*Sender)
{
????????this->Close();????????
}
//---------------------------------------------------------------------------
void?__fastcall?TForm1::BtnOpenClick(Tobject?*Sender)
{
????????try
????????{
??????????????if(MSComm1->PortOpen!=true)
??????????????{
????????????????????MSComm1->CommPort=StrToInt(1)?;
????????????????????MSComm1->Settings=“2400e81“;
????????????????????MSComm1->InputMode?=?1;
????????????????????MSComm1->PortOpen?=?true;
????????????????????MSComm1->SThreshold=0;
????????????????????MSComm1->RThreshold=1;
????????????????????MSComm1->DTREnable=true;
????????????MSComm1->RTSEnable=true;
????????????????????Form1->Caption=“TestPlateform:串口已打開“;
????????????????????Shape1->Brush->Color=clGreen;
????????????????????//AniGIF1->Play();
????????????????????//AniGIF1->Speed?=?1;
????????????????????BtnOpen->Enabled?=false;
????????????????????BtnClose->Enabled?=true;
??????????????}

????????}
????????????????catch(Exception?&exception)
????????????????{
????????????????????????Application->ShowException(&exception);
????????????????}
}
//---------------------------------------------------------------------------
void?__fastcall?TForm1::BtnCloseClick(Tobject?*Sender)
{
????????try
????????{
??????????????if(MSComm1->PortOpen!=false)
??????????????{
????????????????????MSComm1->PortOpen?=?false?;
????????????????????Form1->Caption=“TestPlateform:串口已關閉“;
????????????????????BtnOpen->Enabled?=true;
????????????????????BtnClose->Enabled?=false;
????????????????????M

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1072??2010-06-17?12:44??實驗14\shiyanProject15.cpp

?????文件???????4289??2010-07-02?10:14??實驗14\shiyanProject15.bpr

?????文件??????17832??2010-07-02?10:16??實驗14\shiyanProject15.obj

?????文件????????876??2010-06-17?12:47??實驗14\shiyanProject15.res

?????文件?????431765??2010-07-02?11:10??實驗14\shiyan15.obj

?????文件??????58368??2010-07-02?11:10??實驗14\shiyanProject15.exe

?????文件???????1708??2010-07-02?10:43??實驗14\shiyan15.~h

?????文件????2752512??2010-07-02?11:12??實驗14\shiyanProject15.tds

?????文件???????5447??2010-07-02?10:44??實驗14\shiyan15.~cpp

?????文件???????1708??2010-07-02?10:43??實驗14\shiyan15.h

?????文件???????2332??2010-07-02?10:47??實驗14\shiyan15.dfm

?????文件???????2332??2010-07-02?10:47??實驗14\shiyan15.~dfm

?????文件?????????51??2010-07-02?11:12??實驗14\shiyan15.ddp

?????文件?????????51??2010-07-02?10:47??實驗14\shiyan15.~ddp

?????文件???????5612??2010-07-02?11:16??實驗14\shiyan15.cpp.bak

?????文件???????5663??2010-07-02?11:17??實驗14\shiyan15.cpp

?????目錄??????????0??2010-07-02?10:15??實驗14

-----------?---------??----------?-----??----

??????????????3291618????????????????????17


評論

共有 條評論