试图在D2010中运行AsyncPro.使用Source Forge的5.00版本. 下面的AsyncPro代码(在OOMisc.pas中)失败,并在下面的MakeLong行中使用范围检查错误.我不知道如何开始调试这个. 有没有人在D2010中运行ASyncP
下面的AsyncPro代码(在OOMisc.pas中)失败,并在下面的MakeLong行中使用范围检查错误.我不知道如何开始调试这个.
有没有人在D2010中运行ASyncPro,或者对下面可能发生的事情有所了解?我在SourceForge上的帖子没有回复.
function SafeYield : LongInt;
{-Allow other processes a chance to run}
var
Msg : TMsg;
begin
SafeYield := 0;
if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then begin
if Msg.Message = wm_Quit then
{Re-post quit message so main message loop will terminate}
PostQuitMessage(Msg.WParam)
else begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
{Return message so caller can act on message if necessary}
SafeYield := MAKELONG(Msg.Message, Msg.hwnd); // Range Check Error on this line!
end;
end;
TIA
您似乎使用范围检查编译代码:{$R+}
function Test(A, B: LongWord): LongInt;
begin
Result:= MakeLong(A,B);
// Project .. raised exception class ERangeError with message 'Range check error'.
end;
您可以关闭范围检查以消除运行时错误,但结果是
SafeYield := MAKELONG(Msg.Message, Msg.hwnd)
如果其中一个参数(或两者)高于2 ^ 16 – 1则不正确.
看起来代码从16位AsyncPro版本移植而没有更改为32位版本,并且存在通过所有32位AsyncPro版本的错误.
