- This topic has 8 replies, 2 voices, and was last updated 6 years, 4 months ago by HeDiBo.
-
AuthorPosts
-
June 18, 2018 at 2:17 pm #37875HeDiBoParticipant
Hovering over a TacFloatBtn for retrieving the Hint, there is an access violation when running my application as a WIN64 process:
Code:procedure TacFloatComponent.OnHintTimer(Sender: TObject);
begin
if (FHintTimer <> nil) and (TObject(FHintTimer.Tag) is TacFloatBtn) then // Produces the access violation
with TacFloatBtn(FHintTimer.Tag) do begin
FHintTimer.Enabled := False;
if (AForm <> nil) and PtInRect(AForm.BoundsRect, acMousePos) then
DoShowHintWnd(TObject(FHintTimer.Tag));
end;
end;This is the stack at the moment of the error:
Code:System._IsClass($FFFFFFFFFB0B01E0,TClass($150E7A0))
acFloatCtrls.TacFloatComponent.OnHintTimer($7FF4FA933AE0)
Vcl.ExtCtrls.TTimer.Timer
Vcl.ExtCtrls.TTimer.WndProc($14FBB0)
System.Classes.StdWndProc(???,???,???,???)
:00007FFFB9766CC1 ; C:WINDOWSSystem32user32.dll
:00007FFFB9766693 ; C:WINDOWSSystem32user32.dll
Vcl.Forms.TApplication.ProcessMessage(???)
Vcl.Forms.TApplication.HandleMessage
Vcl.Forms.TApplication.RunJune 19, 2018 at 9:30 am #58059HeDiBoParticipantRedefining the hint timer as this:
Code:TsTimer = class(TTimer)
protected
FOwner: TObject;
end{class};and making the appropriate adjustments in TacFloatBtn.pas, replacing the use of the Tag property with the FOwner property will do the trick.
The same problem could arise in procedure TsSkinProvider.StartHintTimer(TitleItem: TacTitleBarItem);
June 20, 2018 at 5:02 am #58069SupportKeymasterThank you for researching, I will check it soon.
June 24, 2018 at 2:46 pm #58077SupportKeymasterHello!
Can you help me to repeat this error in the test-application? Is it possible?
June 24, 2018 at 5:34 pm #58078HeDiBoParticipant'Support' wrote:Hello!
Can you help me to repeat this error in the test-application? Is it possible?
Your code uses a Tag (which is a NativeInt) as a pointer to a TObject (which is 64 bits Word in the Win64 binary).
That's what's wrong, I think.
But my problem is only reproducable if the object resides at an address that requires more than 63 bits and has the sign set.
By the way, my solution works, I implemented it in the appropriate places in AC and got rid of the problem.
June 25, 2018 at 6:59 am #58079SupportKeymasterYou are right, I will change it in the nearest release.
July 4, 2018 at 3:54 pm #58094HeDiBoParticipant'Support' wrote:You are right, I will change it in the nearest release.
The sSkinProvider module has the same problem:
Code:procedure TsSkinProvider.OnHintTimer(Sender: TObject);
begin
if (FHintTimer nil) and (FHintTimer.Tag 0) then begin
FHintTimer.Enabled := False;
if PtInRect(FHintRect, acMousePos) then
ShowHintWnd(TacTitleBarItem(FHintTimer.Tag)); // This causes trouble
end;
end;Making a similar change as in TacFloatBtn, solved this problem too.
July 9, 2018 at 11:53 am #58117SupportKeymasterThis code will be changed in the nearest release, also.
July 17, 2018 at 11:42 am #58172HeDiBoParticipant'Support' wrote:This code will be changed in the nearest release, also.
Problem solved in AC 13.17
-
AuthorPosts
- You must be logged in to reply to this topic.