Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Tokyo 10.2.2 ICE: Internal compiler error: C0000005 @ Android and IOS


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Feb 6, 2018 12:50 AM Last Post By: Andreas Wegener Threads: [ Previous | Next ]
Andreas Wegener

Posts: 25
Registered: 12/6/12
Tokyo 10.2.2 ICE: Internal compiler error: C0000005 @ Android and IOS  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 4, 2018 11:30 PM
Hi Forum.
I like to get the position of a control e.g. a TButton in the form.
That button is placed in e.g. a TRectangle
The position of a control is only relative to its current parent so I loop through all parents of a control and add X and Y position.

This works well under Windows but can’t be compiled with Android or IOS under Tokyo 10.2.2

Berlin 10.1.1 can compile

ICE: Internal compiler error: C0000005 @ 38B980FD

That is why :

CurrentControl=CurrentControl->ParentControl;

Is this a compiler bug or do I have the wrong approach ?
Thanks

void __fastcall TForm1::Button1Click(TObject *Sender)
{
	TControl * CurrentControl=this->Button1;
	int CurrentDeep=0;
	int Deep=1 ;
	 TPointF RetPos;
	RetPos.X=CurrentControl->Position->X;
	RetPos.Y=CurrentControl->Position->Y;
 
	while ((CurrentControl->HasParent()) && (CurrentDeep <Deep) )
	{
	   CurrentControl=CurrentControl->ParentControl;
 
	   RetPos.X+=CurrentControl->Position->X;
	   RetPos.Y+=CurrentControl->Position->Y;
	   CurrentDeep++;
	}
   Label1->Text= UnicodeString(RetPos.X)+"/"+UnicodeString(RetPos.Y);
}
Andreas Wegener

Posts: 25
Registered: 12/6/12
Re: Tokyo 10.2.2 ICE: Internal compiler error: C0000005 @ Android and IOS  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 6, 2018 12:50 AM   in response to: Andreas Wegener in response to: Andreas Wegener
Workaround is to add an additional temp variable


while ((CurrentControl->HasParent()) && (CurrentDeep<Deep) )
	 {
		TControl *ParControl =CurrentControl->ParentControl;
		RetPos.X+=ParControl->Position->X;
		RetPos.Y+=ParControl->Position->Y;
		CurrentDeep++;
		CurrentControl = ParControl;
     }
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02