Вниз
Скачать: 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.014 c
1-99524
wolf01
2003-12-16 14:16
2003.12.30
Узнать о изменеии свойства Visible


14-99781
avk02
2003-12-03 04:53
2003.12.30
Корпус Xaser III v2000 Super Tower


14-99697
albatros
2003-12-09 19:07
2003.12.30
Программа, обеспечивающая взаимодействие операцонной системы с пе


14-99726
Сатир
2003-12-08 18:15
2003.12.30
subj


1-99608
Vitaliygavrilov
2003-12-17 10:55
2003.12.30
Возможно ли при работе программы изменить ее интерфейс




   Наверх