|
혹시 form2 에 해당 이벤트를 추가 시키거나 변경시킬수 있는 방법이 있다면 알려주세요!!
void __fastcall TForm2::Serial1Event_RXCHAR(TSerial *Sender, BYTE *Buffer, //원래는 TForm1 으로 돼있음
WORD Size)
{
AnsiString strTemp;
AnsiString strCurr;
BYTE data;
for(int i=0; i<Size; i++){
data = Buffer[i];
if(chkHex->Checked){
if(data > 0x0f) strTemp = Format("0x%2x ", ARRAYOFCONST((data)));
else strTemp = Format("0x0%1x ", ARRAYOFCONST((data)));
}
else{
char buf[10];
sprintf(buf, "%c", data);
strTemp = buf;
}
strCurr += strTemp;
}
while(Memo1->Lines->Count > 400) Memo1->Lines->Delete(0);
/*
if (LineCount < 10) strCurr = Format(">>000%d : ", ARRAYOFCONST((LineCount))) + strCurr;
else if(LineCount < 100) strCurr = Format(">>00%d : ", ARRAYOFCONST((LineCount))) + strCurr;
else if(LineCount < 1000) strCurr = Format(">>0%d : ", ARRAYOFCONST((LineCount))) + strCurr;
*/
strCurr = FormatFloat(">>0000 : ", LineCount) + strCurr;
Memo1->Lines->BeginUpdate();
Memo1->Lines->Add(strCurr);
Memo1->Lines->EndUpdate();
LineCount++;
if(LineCount > 9999) LineCount = 0;
// Memo1->SelStart = strlen(Memo1->Text.c_str())-1;
SendMessage(Memo1->Handle, WM_VSCROLL, SB_BOTTOM, 0);
}
문경재 님이 쓰신 글 :
: 에러문장만 봤을땐 Serial1Event_RXCHAR라는 이벤트가
: form2에 속해있지 않은겁니다.
:
: 구현부분은 있지만 form2에 해당 이벤트가 선언되어 있지 않은것 같네요
:
: 자세한건 소스전체를 봐야 알것 같습니다만..
:
:
: 칸나기 님이 쓰신 글 :
: : 갓 빌더에 입문한 초보 입니다. 시리얼 통신 프로그램을 돌려 보려고 제작 중인데
: : 다른 소스를 끌어다가 되는가 테스트를 해보던중
: : [BCC32 Error] SEM.cpp(198): E2316 '_fastcall TForm2::Serial1Event_RXCHAR(TSerial *,unsigned char *,unsigned short)' is not a member of 'TForm2'
: : 이런 메세지가 떠서 어떻게 해야되는지 잘 모르겠네요
: : 원 소스는 form1을 써서 에러가 나는건지 고수님들 도와주세요!!
|