Вниз
Скачать: CL | DM;

проблемы при работе с com портом   Найти похожие ветки 

← →
DelphiNew ©   (2003-10-22 15:12) [0]

Люди помогите пожалуйста есть такая процедурка
procedure TForm1.CreatPort;
Begin
CommHandle := CreateFile("COM2",GENERIC_READ or GENERIC_WRITE,0,nil,OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED,0);
SetCommMask(CommHandle,EV_RXFLAG or EV_BREAK);

GetCommState(CommHandle,DCB);
DCB.BaudRate:=CBR_9600;
DCB.Parity:=NOPARITY;
DCB.ByteSize:=8;
DCB.StopBits:=OneStopBit;
//DCB.EvtChar:=chr(13);
SetupComm (CommHandle, 256, 256);
SetCommState(CommHandle,DCB);
CommThread := CreateThread(nil,0,@ReadComm,nil,0,ThreadID);
end;
на строке CommThread:=... выдаёт ошибку variable required
не могу понять в чом проблема


← →
DelphiNew ©   (2003-10-23 11:03) [1]

не ужели ни кто не может помочь7?????


← →
Reindeer Moss Eater ©   (2003-10-23 11:07) [2]

Последний параметр должен быть переменная.
Что такое ThreadID ?


← →
DelphiNew ©   (2003-10-23 11:38) [3]

Это ID потока по документации последним должен стоять именно он


← →
Reindeer Moss Eater ©   (2003-10-23 11:40) [4]

ДЕКЛАРАЦИЮ ThreadID покажи. Что должно стоять я и сам знаю.


← →
DelphiNew ©   (2003-10-23 12:08) [5]

ThreadID:dword;


← →
Reindeer Moss Eater ©   (2003-10-23 12:18) [6]

ReadComm ?


← →
Reindeer Moss Eater ©   (2003-10-23 12:22) [7]

Скорее всего твоя ReadComm - метод класса.


← →
Reindeer Moss Eater ©   (2003-10-23 12:27) [8]

А требуется :
function(AData:Pointer) : DWORD;


← →
DelphiNew ©   (2003-10-23 12:33) [9]

type
......
procedure CreatPort;
procedure READCOMM;
procedure Button1Click(Sender: TObject);
.......
procedure ReadComm;
var
Resive:array [0..255] of char;
Begin
while true do
TransMask:=0;
WaitCommEvent(CommHandle,TransMask,@Ovr);
if (TransMask and EV_RXCHAR)=EV_RXCHAR then
begin
ClearCommError(CommHandle,Errs,@Stat);
Kols := Stat.cbInQue;
ReadFile(CommHandle,Resive,Kols,Kols,@Ovr);
Form1.Edit1.Text:=string(Resive);
end;
End;


← →
Reindeer Moss Eater ©   (2003-10-23 12:38) [10]

[7]
[8]


← →
DelphiNew ©   (2003-10-23 12:46) [11]

что это такое?


← →
Reindeer Moss Eater ©   (2003-10-23 13:02) [12]

Это
Reindeer Moss Eater © (23.10.03 12:22) [7]
и
Reindeer Moss Eater © (23.10.03 12:27) [8]



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.47 MB
Время: 0.011 c
6-99682
Фагот
2003-10-30 14:33
2003.12.30
POP3


14-99757
Rafe
2003-12-07 02:46
2003.12.30
Сайт для он-лайн слежкой за результатами выборов...


1-99596
Эли
2003-12-17 13:48
2003.12.30
drag&


3-99473
zxc
2003-12-05 09:05
2003.12.30
Перенос данных из одной БД в другую


14-99732
Layner
2003-12-08 11:32
2003.12.30
Помогите купить лиц. D7. Контора (сайт) / цена




   Наверх