procedure ThreadPro(X: Integer); stdcall;
var
timer1:TTimer1;
MsgStruct: TMsg;
hMutexObj: DWORD;
begin
hMutexObj := CreateMutex(nil, FALSE, DllMutex);
timer1:=ttimer.Create(nil);
timer1.OnTimer:=TimerExee; //这里出错,错误提示在后面附上
timer1.Interval:=5000;
timer1.Enabled:=true;
// Register_MainForm;
//Create_MainForm;
while GetMessage(MsgStruct, 0, 0, 0) do
begin
case msgstruct.message of
wm_close: BEGIN
MessageBox(0,' wm_close退出','插入',1);
exit;
END;
wm_quit:begin
MessageBox(0,' wm_quit退出','插入',1);
exit;
end;
wm_vscroll:BEGIN
MessageBox(0,'wm_vscroll 被滚动','插入',1);
END;
end;
//TranslateMessage(MsgStruct);
//DispatchMessage(MsgStruct);
end;
//Unregister_MainForm;
错误提示
Incompatble types:'Calling conventions differ'
Cou ld not compile used unit 'Thread.pas'
var
timer1:TTimer1;
MsgStruct: TMsg;
hMutexObj: DWORD;
begin
hMutexObj := CreateMutex(nil, FALSE, DllMutex);
timer1:=ttimer.Create(nil);
timer1.OnTimer:=TimerExee; //这里出错,错误提示在后面附上
timer1.Interval:=5000;
timer1.Enabled:=true;
// Register_MainForm;
//Create_MainForm;
while GetMessage(MsgStruct, 0, 0, 0) do
begin
case msgstruct.message of
wm_close: BEGIN
MessageBox(0,' wm_close退出','插入',1);
exit;
END;
wm_quit:begin
MessageBox(0,' wm_quit退出','插入',1);
exit;
end;
wm_vscroll:BEGIN
MessageBox(0,'wm_vscroll 被滚动','插入',1);
END;
end;
//TranslateMessage(MsgStruct);
//DispatchMessage(MsgStruct);
end;
//Unregister_MainForm;
错误提示
Incompatble types:'Calling conventions differ'
Cou ld not compile used unit 'Thread.pas'
i: integer;procedure TForm1.MyTimer(Sender: TObject);
begin
Caption:= inttostr(i);
i:= i+1;
end;procedure TForm1.FormCreate(Sender: TObject);
var
t: TTimer;
begin
t:= TTimer.Create(self);
t.Enabled:= true;
t.Interval:= 500;
t.OnTimer:= MyTimer;
end;没问题的,看看你的过程定义吧
我是有纯API写的,我的过程没有问题,是不是在纯API里写的程序还要加什么东西