关于Application.ProcessMessages请教
procedure PDelay(ms: Integer);
var
beginTick, endTick :Integer;
begin
beginTick := GetTickCount();
while True do
begin
Application.ProcessMessages;
endTick :=GetTickCount;
Sleep(1);
if (endTick - beginTick) > mS then Break;
end;
end;
这是一个类似sleep的函数,以前一直用的好好的,前两天有个程序用了这个,每次运行到Application.ProcessMessages;就会出现BUG,BUG提示:
Project ReadDataPrj.exe raised exception class EAccessViolation with message 'Access violation at address 004AEC03 in module'ReadDataPrj.exe'. Write of address C8EOF23F'. Process stopped, User Step or Run to continue;
我想请教下这是怎么回事?