Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.09.24;
Скачать: CL | DM;

Вниз

KOL NewThreadEx( ???? )   Найти похожие ветки 

 
_Simon_   (2005-11-27 12:56) [0]

Как использовать Кол класс PThread без MCK:

У меня не работает такой код

unit Un_my;
interface

uses
 kol, windows;
var
Thr:PThread;

function ThrExecute(Sender: PThread): Integer;

implementation

function ThrExecute(Sender: PThread): Integer;
var
 i: Integer;
begin
 for i:= 0 to 2 do begin
   MessageBeep($40);
   Sleep(200);
 end;

end;

initialization

 // Incompatible types:
 Thr:=NewThreadEx(ThrExecute);      //  Metod pointer and regular procedure
//  Thr:=NewThreadEx(@ThrExecute); //  TOnThreadExecute and pointer
 Thr.AutoFree:=false;
 Thr.Resume;

finalization
 Thr.Free;
end.



Чем отличается

   Result.Thread1 := NewThreadEx( Result.Thread1Execute );

из "Unit1_1.inc" генерируемой MCK?


 
thaddy   (2005-11-27 13:42) [1]


 //declaration
 TOnThreadExecute = function(Sender:PThread): Integer of object;
   
                 
Again, someone forgot the dummy parameter here?


function ThrExecute(Dummy:pointer;Sender: PThread): Integer;



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

Текущий архив: 2006.09.24;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.07 c
2-1156982136
AlDun
2006-08-31 03:55
2006.09.24
Access Violation


15-1157312649
ramzes2
2006-09-03 23:44
2006.09.24
проблемы с CreateParams


15-1157281466
Desdechado
2006-09-03 15:04
2006.09.24
Тип запуска для драйвера


9-1135614705
Ford
2005-12-26 19:31
2006.09.24
Книга DirectX


2-1157364800
Ragazor
2006-09-04 14:13
2006.09.24
Как создать в Dll переменную TDataModule из DataModule1.pas