Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".


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


Permlink Replies: 16 - Last Post: Apr 22, 2016 5:08 AM Last Post By: Rudy Velthuis (...
Joes Yuan

Posts: 45
Registered: 9/23/05
[XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2015 7:03 PM
When scroll on windows or pan on android inside scrollbox, show this error "Invalid class typecast". the code as follow.
Please help me.

>>>Unit1.pas
unit Unit1;
 
interface
 
uses
  System.SysUtils, System.Types, FMX.Types, FMX.Gestures, FMX.StdCtrls, System.Math,
  FMX.Controls, FMX.Controls.Presentation, FMX.Layouts, System.Classes, FMX.Forms,
  FMX.Dialogs, System.Rtti;
 
type
  TForm1 = class(TForm)
    GestureManager1: TGestureManager;
    StyleBook1: TStyleBook;
    Layout1: TLayout;
    ScaledLayout1: TScaledLayout;
    Panel1: TPanel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    xcnt:Integer;
    ycnt:Integer;
    procedure Init;
    Procedure ItemClick(Sender:Tobject);
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.fmx}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  xcnt:=4;  ycnt:=2;
end;
 
procedure TForm1.FormShow(Sender: TObject);
begin
  Init;
end;
 
procedure TForm1.Init;
Var
  i,k,cnt:Integer;
  vsb:TVertScrollBox;
  gl:TGridLayout;
  Panel:TPanel;
begin
  vsb:=TVertScrollBox.Create(Layout1);
  vsb.Align:=TAlignLayout.Client;
  vsb.Touch.GestureManager:=GestureManager1;
  vsb.Touch.InteractiveGestures:=[TInteractiveGesture.Pan];
  Layout1.AddObject(vsb);
 
  gl:=TGridLayout.Create(vsb);
  gl.Width:=vsb.Width;
  gl.ItemWidth:=vsb.Width/xcnt;
  gl.ItemHeight:=vsb.Height/ycnt;
  vsb.AddObject(gl);
 
  k:=20;
  cnt:=(k-1) div xcnt+1;
  gl.Height:=max(cnt*gl.ItemHeight+20,vsb.Height);
 
  for i := 1 to k do
  begin
    panel:=TPanel.Create(gl);
    panel.Parent:=gl;
 
    panel.StyleLookup:='ItemStyle';
    panel.StylesData['NameStyle']:='hello world!';
    panel.StylesData['NameStyle.OnClick']:=TValue.From<TNotifyEvent>(ItemClick);
 
    gl.AddObject(panel);
  end;
end;
 
Procedure TForm1.ItemClick(Sender:Tobject);
begin
  ShowMessage('Click');
end;
 
initialization
  RegisterClasses([TForm1]);
 
end.


>>>Unit1.fmx
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'TabbedwithNavigation'
  ClientHeight = 600
  ClientWidth = 960
  StyleBook = StyleBook1
  FormFactor.Width = 1440
  FormFactor.Height = 900
  FormFactor.Devices = [Desktop]
  OnCreate = FormCreate
  OnShow = FormShow
  DesignerMasterStyle = 0
  object StyleBook1: TStyleBook
    Styles = <
      item
        ResourcesBin = {
          464D585F5354594C4520322E350106094974656D5374796C65034A0300545046
          300D545363616C65644C61796F757400095374796C654E616D6506094974656D
          5374796C650D4F726967696E616C57696474680500000000000000DB06400E4F
          726967696E616C4865696768740500000000000000F806400C4D617267696E73
          2E4C6566740500000000000000A002400B4D617267696E732E546F7005000000
          00000000A002400D4D617267696E732E52696768740500000000000000A00240
          0E4D617267696E732E426F74746F6D0500000000000000A002400A506F736974
          696F6E2E580500000000000000A207400A506F736974696F6E2E590500000000
          000000DC05400A53697A652E57696474680500000000000000DB06400B53697A
          652E4865696768740500000000000000F806401453697A652E506C6174666F72
          6D44656661756C7408000A5452656374616E676C6500095374796C654E616D65
          0602626705416C69676E0708436F6E74656E74730A46696C6C2E436F6C6F7207
          08636C614265696765074869745465737408074F706163697479050000000000
          6666E6FE3F0A53697A652E57696474680500000000000000DB06400B53697A65
          2E4865696768740500000000000000F806401453697A652E506C6174666F726D
          44656661756C74080C5374726F6B652E436F6C6F720708636C61576869746507
          585261646975730500000000000000C000400759526164697573050000000000
          0000C00040000006544C6162656C00095374796C654E616D6506094E616D6553
          74796C6505416C69676E0706436C69656E740E5374796C656453657474696E67
          730B000748697454657374090A53697A652E57696474680500000000000000DB
          06400B53697A652E4865696768740500000000000000F806401453697A652E50
          6C6174666F726D44656661756C7408185465787453657474696E67732E466F6E
          742E46616D696C791204000000AE5F6F8FC596D19E165465787453657474696E
          67732E466F6E742E53697A650500000000000000E00340175465787453657474
          696E67732E466F6E742E5374796C650B066673426F6C64001654657874536574
          74696E67732E466F6E74436F6C6F720709636C61496E6469676F165465787453
          657474696E67732E486F727A416C69676E070643656E74657204546578740604
          4E616D65000000}
      end>
    Left = 56
    Top = 104
  end
  object ScaledLayout1: TScaledLayout
    Align = Client
    OriginalWidth = 960.000000000000000000
    OriginalHeight = 600.000000000000000000
    Size.Width = 960.000000000000000000
    Size.Height = 600.000000000000000000
    Size.PlatformDefault = False
    object Layout1: TLayout
      Align = Client
      Size.Width = 960.000000000000000000
      Size.Height = 559.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 0
    end
    object Panel1: TPanel
      Align = Top
      Size.Width = 960.000000000000000000
      Size.Height = 41.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 1
      object Button1: TButton
        Position.X = 16.000000000000000000
        Position.Y = 8.000000000000000000
        TabOrder = 12
        Text = 'Close'
        OnClick = Button1Click
      end
    end
  end
  object GestureManager1: TGestureManager
    Sensitivity = 80.000000000000000000
    Left = 160
    Top = 104
  end
end


>>>StyleBook1
object TStyleContainer
  object TScaledLayout
    StyleName = 'ItemStyle'
    OriginalWidth = 219.000000000000000000
    OriginalHeight = 248.000000000000000000
    Margins.Left = 10.000000000000000000
    Margins.Top = 10.000000000000000000
    Margins.Right = 10.000000000000000000
    Margins.Bottom = 10.000000000000000000
    Position.X = 324.000000000000000000
    Position.Y = 110.000000000000000000
    Size.Width = 219.000000000000000000
    Size.Height = 248.000000000000000000
    Size.PlatformDefault = False
    Visible = False
    object TRectangle
      StyleName = 'bg'
      Align = Contents
      Fill.Color = claBeige
      HitTest = False
      Opacity = 0.899999976158142100
      Size.Width = 219.000000000000000000
      Size.Height = 248.000000000000000000
      Size.PlatformDefault = False
      Stroke.Color = claWhite
      XRadius = 3.000000000000000000
      YRadius = 3.000000000000000000
    end
    object TLabel
      StyleName = 'NameStyle'
      Align = Client
      StyledSettings = []
      HitTest = True
      Size.Width = 219.000000000000000000
      Size.Height = 248.000000000000000000
      Size.PlatformDefault = False
      TextSettings.Font.Family = #24494#36719#38597#40657
      TextSettings.Font.Size = 28.000000000000000000
      TextSettings.Font.Style = [fsBold]
      TextSettings.FontColor = claIndigo
      TextSettings.HorzAlign = Center
      Text = 'Name'
    end
  end
end
Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 4, 2016 3:40 AM   in response to: Joes Yuan in response to: Joes Yuan
The code is very simple, just copy and paste, you will get the error.

Please help me!

Joes Yuan wrote:
When scroll on windows or pan on android inside scrollbox, show this error "Invalid class typecast". the code as follow.
Please help me.

>>>Unit1.pas
unit Unit1;
 
interface
 
uses
  System.SysUtils, System.Types, FMX.Types, FMX.Gestures, FMX.StdCtrls, System.Math,
  FMX.Controls, FMX.Controls.Presentation, FMX.Layouts, System.Classes, FMX.Forms,
  FMX.Dialogs, System.Rtti;
 
type
  TForm1 = class(TForm)
    GestureManager1: TGestureManager;
    StyleBook1: TStyleBook;
    Layout1: TLayout;
    ScaledLayout1: TScaledLayout;
    Panel1: TPanel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    xcnt:Integer;
    ycnt:Integer;
    procedure Init;
    Procedure ItemClick(Sender:Tobject);
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.fmx}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  xcnt:=4;  ycnt:=2;
end;
 
procedure TForm1.FormShow(Sender: TObject);
begin
  Init;
end;
 
procedure TForm1.Init;
Var
  i,k,cnt:Integer;
  vsb:TVertScrollBox;
  gl:TGridLayout;
  Panel:TPanel;
begin
  vsb:=TVertScrollBox.Create(Layout1);
  vsb.Align:=TAlignLayout.Client;
  vsb.Touch.GestureManager:=GestureManager1;
  vsb.Touch.InteractiveGestures:=[TInteractiveGesture.Pan];
  Layout1.AddObject(vsb);
 
  gl:=TGridLayout.Create(vsb);
  gl.Width:=vsb.Width;
  gl.ItemWidth:=vsb.Width/xcnt;
  gl.ItemHeight:=vsb.Height/ycnt;
  vsb.AddObject(gl);
 
  k:=20;
  cnt:=(k-1) div xcnt+1;
  gl.Height:=max(cnt*gl.ItemHeight+20,vsb.Height);
 
  for i := 1 to k do
  begin
    panel:=TPanel.Create(gl);
    panel.Parent:=gl;
 
    panel.StyleLookup:='ItemStyle';
    panel.StylesData['NameStyle']:='hello world!';
    panel.StylesData['NameStyle.OnClick']:=TValue.From<TNotifyEvent>(ItemClick);
 
    gl.AddObject(panel);
  end;
end;
 
Procedure TForm1.ItemClick(Sender:Tobject);
begin
  ShowMessage('Click');
end;
 
initialization
  RegisterClasses([TForm1]);
 
end.


>>>Unit1.fmx
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'TabbedwithNavigation'
  ClientHeight = 600
  ClientWidth = 960
  StyleBook = StyleBook1
  FormFactor.Width = 1440
  FormFactor.Height = 900
  FormFactor.Devices = [Desktop]
  OnCreate = FormCreate
  OnShow = FormShow
  DesignerMasterStyle = 0
  object StyleBook1: TStyleBook
    Styles =        item
        ResourcesBin = {
          464D585F5354594C4520322E350106094974656D5374796C65034A0300545046
          300D545363616C65644C61796F757400095374796C654E616D6506094974656D
          5374796C650D4F726967696E616C57696474680500000000000000DB06400E4F
          726967696E616C4865696768740500000000000000F806400C4D617267696E73
          2E4C6566740500000000000000A002400B4D617267696E732E546F7005000000
          00000000A002400D4D617267696E732E52696768740500000000000000A00240
          0E4D617267696E732E426F74746F6D0500000000000000A002400A506F736974
          696F6E2E580500000000000000A207400A506F736974696F6E2E590500000000
          000000DC05400A53697A652E57696474680500000000000000DB06400B53697A
          652E4865696768740500000000000000F806401453697A652E506C6174666F72
          6D44656661756C7408000A5452656374616E676C6500095374796C654E616D65
          0602626705416C69676E0708436F6E74656E74730A46696C6C2E436F6C6F7207
          08636C614265696765074869745465737408074F706163697479050000000000
          6666E6FE3F0A53697A652E57696474680500000000000000DB06400B53697A65
          2E4865696768740500000000000000F806401453697A652E506C6174666F726D
          44656661756C74080C5374726F6B652E436F6C6F720708636C61576869746507
          585261646975730500000000000000C000400759526164697573050000000000
          0000C00040000006544C6162656C00095374796C654E616D6506094E616D6553
          74796C6505416C69676E0706436C69656E740E5374796C656453657474696E67
          730B000748697454657374090A53697A652E57696474680500000000000000DB
          06400B53697A652E4865696768740500000000000000F806401453697A652E50
          6C6174666F726D44656661756C7408185465787453657474696E67732E466F6E
          742E46616D696C791204000000AE5F6F8FC596D19E165465787453657474696E
          67732E466F6E742E53697A650500000000000000E00340175465787453657474
          696E67732E466F6E742E5374796C650B066673426F6C64001654657874536574
          74696E67732E466F6E74436F6C6F720709636C61496E6469676F165465787453
          657474696E67732E486F727A416C69676E070643656E74657204546578740604
          4E616D65000000}
      end>
    Left = 56
    Top = 104
  end
  object ScaledLayout1: TScaledLayout
    Align = Client
    OriginalWidth = 960.000000000000000000
    OriginalHeight = 600.000000000000000000
    Size.Width = 960.000000000000000000
    Size.Height = 600.000000000000000000
    Size.PlatformDefault = False
    object Layout1: TLayout
      Align = Client
      Size.Width = 960.000000000000000000
      Size.Height = 559.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 0
    end
    object Panel1: TPanel
      Align = Top
      Size.Width = 960.000000000000000000
      Size.Height = 41.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 1
      object Button1: TButton
        Position.X = 16.000000000000000000
        Position.Y = 8.000000000000000000
        TabOrder = 12
        Text = 'Close'
        OnClick = Button1Click
      end
    end
  end
  object GestureManager1: TGestureManager
    Sensitivity = 80.000000000000000000
    Left = 160
    Top = 104
  end
end


>>>StyleBook1
object TStyleContainer
  object TScaledLayout
    StyleName = 'ItemStyle'
    OriginalWidth = 219.000000000000000000
    OriginalHeight = 248.000000000000000000
    Margins.Left = 10.000000000000000000
    Margins.Top = 10.000000000000000000
    Margins.Right = 10.000000000000000000
    Margins.Bottom = 10.000000000000000000
    Position.X = 324.000000000000000000
    Position.Y = 110.000000000000000000
    Size.Width = 219.000000000000000000
    Size.Height = 248.000000000000000000
    Size.PlatformDefault = False
    Visible = False
    object TRectangle
      StyleName = 'bg'
      Align = Contents
      Fill.Color = claBeige
      HitTest = False
      Opacity = 0.899999976158142100
      Size.Width = 219.000000000000000000
      Size.Height = 248.000000000000000000
      Size.PlatformDefault = False
      Stroke.Color = claWhite
      XRadius = 3.000000000000000000
      YRadius = 3.000000000000000000
    end
    object TLabel
      StyleName = 'NameStyle'
      Align = Client
      StyledSettings = []
      HitTest = True
      Size.Width = 219.000000000000000000
      Size.Height = 248.000000000000000000
      Size.PlatformDefault = False
      TextSettings.Font.Family = #24494#36719#38597#40657
      TextSettings.Font.Size = 28.000000000000000000
      TextSettings.Font.Style = [fsBold]
      TextSettings.FontColor = claIndigo
      TextSettings.HorzAlign = Center
      Text = 'Name'
    end
  end
end
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 4, 2016 8:02 AM   in response to: Joes Yuan in response to: Joes Yuan
It's a bug in plain XE10. I didn't installed the update yet so don't
know whenever this is solved or not.

What I can see in plain XE10 is that only for the first panel
FStylesData is nil in SetStyleData for every panel after that it's
already assigned. It should be a strict private field but behaves like
strict private class var.
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 4, 2016 9:07 AM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Same thing happens with your code in Update 1. Don't know what's wrong.
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 4, 2016 3:07 PM   in response to: Douglas Rudd in response to: Douglas Rudd
Am 04.01.2016 um 18:07 schrieb Douglas Rudd:
Same thing happens with your code in Update 1. Don't know what's wrong.

Hello,

if its a bug the OP shoulkd create an issue in quality.embarcadero.com
and post the number here, so we can track it if we wish and maybe help
him to improve his wordings if necessary.

Greetings

Markus
Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 6, 2016 5:12 PM   in response to: Markus Humm in response to: Markus Humm
https://quality.embarcadero.com/browse/RSP-13371

Markus Humm wrote:
Am 04.01.2016 um 18:07 schrieb Douglas Rudd:
Same thing happens with your code in Update 1. Don't know what's wrong.

Hello,

if its a bug the OP shoulkd create an issue in quality.embarcadero.com
and post the number here, so we can track it if we wish and maybe help
him to improve his wordings if necessary.

Greetings

Markus
Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 24, 2016 5:38 PM   in response to: Joes Yuan in response to: Joes Yuan
Who can test the new version, if this bug is fixed?

Joes Yuan wrote:
When scroll on windows or pan on android inside scrollbox, show this error "Invalid class typecast". the code as follow.
Please help me.

>>>Unit1.pas
unit Unit1;
 
interface
 
uses
  System.SysUtils, System.Types, FMX.Types, FMX.Gestures, FMX.StdCtrls, System.Math,
  FMX.Controls, FMX.Controls.Presentation, FMX.Layouts, System.Classes, FMX.Forms,
  FMX.Dialogs, System.Rtti;
 
type
  TForm1 = class(TForm)
    GestureManager1: TGestureManager;
    StyleBook1: TStyleBook;
    Layout1: TLayout;
    ScaledLayout1: TScaledLayout;
    Panel1: TPanel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    xcnt:Integer;
    ycnt:Integer;
    procedure Init;
    Procedure ItemClick(Sender:Tobject);
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.fmx}
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;
 
procedure TForm1.FormCreate(Sender: TObject);
begin
  xcnt:=4;  ycnt:=2;
end;
 
procedure TForm1.FormShow(Sender: TObject);
begin
  Init;
end;
 
procedure TForm1.Init;
Var
  i,k,cnt:Integer;
  vsb:TVertScrollBox;
  gl:TGridLayout;
  Panel:TPanel;
begin
  vsb:=TVertScrollBox.Create(Layout1);
  vsb.Align:=TAlignLayout.Client;
  vsb.Touch.GestureManager:=GestureManager1;
  vsb.Touch.InteractiveGestures:=[TInteractiveGesture.Pan];
  Layout1.AddObject(vsb);
 
  gl:=TGridLayout.Create(vsb);
  gl.Width:=vsb.Width;
  gl.ItemWidth:=vsb.Width/xcnt;
  gl.ItemHeight:=vsb.Height/ycnt;
  vsb.AddObject(gl);
 
  k:=20;
  cnt:=(k-1) div xcnt+1;
  gl.Height:=max(cnt*gl.ItemHeight+20,vsb.Height);
 
  for i := 1 to k do
  begin
    panel:=TPanel.Create(gl);
    panel.Parent:=gl;
 
    panel.StyleLookup:='ItemStyle';
    panel.StylesData['NameStyle']:='hello world!';
    panel.StylesData['NameStyle.OnClick']:=TValue.From<TNotifyEvent>(ItemClick);
 
    gl.AddObject(panel);
  end;
end;
 
Procedure TForm1.ItemClick(Sender:Tobject);
begin
  ShowMessage('Click');
end;
 
initialization
  RegisterClasses([TForm1]);
 
end.


>>>Unit1.fmx
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'TabbedwithNavigation'
  ClientHeight = 600
  ClientWidth = 960
  StyleBook = StyleBook1
  FormFactor.Width = 1440
  FormFactor.Height = 900
  FormFactor.Devices = [Desktop]
  OnCreate = FormCreate
  OnShow = FormShow
  DesignerMasterStyle = 0
  object StyleBook1: TStyleBook
    Styles =        item
        ResourcesBin = {
          464D585F5354594C4520322E350106094974656D5374796C65034A0300545046
          300D545363616C65644C61796F757400095374796C654E616D6506094974656D
          5374796C650D4F726967696E616C57696474680500000000000000DB06400E4F
          726967696E616C4865696768740500000000000000F806400C4D617267696E73
          2E4C6566740500000000000000A002400B4D617267696E732E546F7005000000
          00000000A002400D4D617267696E732E52696768740500000000000000A00240
          0E4D617267696E732E426F74746F6D0500000000000000A002400A506F736974
          696F6E2E580500000000000000A207400A506F736974696F6E2E590500000000
          000000DC05400A53697A652E57696474680500000000000000DB06400B53697A
          652E4865696768740500000000000000F806401453697A652E506C6174666F72
          6D44656661756C7408000A5452656374616E676C6500095374796C654E616D65
          0602626705416C69676E0708436F6E74656E74730A46696C6C2E436F6C6F7207
          08636C614265696765074869745465737408074F706163697479050000000000
          6666E6FE3F0A53697A652E57696474680500000000000000DB06400B53697A65
          2E4865696768740500000000000000F806401453697A652E506C6174666F726D
          44656661756C74080C5374726F6B652E436F6C6F720708636C61576869746507
          585261646975730500000000000000C000400759526164697573050000000000
          0000C00040000006544C6162656C00095374796C654E616D6506094E616D6553
          74796C6505416C69676E0706436C69656E740E5374796C656453657474696E67
          730B000748697454657374090A53697A652E57696474680500000000000000DB
          06400B53697A652E4865696768740500000000000000F806401453697A652E50
          6C6174666F726D44656661756C7408185465787453657474696E67732E466F6E
          742E46616D696C791204000000AE5F6F8FC596D19E165465787453657474696E
          67732E466F6E742E53697A650500000000000000E00340175465787453657474
          696E67732E466F6E742E5374796C650B066673426F6C64001654657874536574
          74696E67732E466F6E74436F6C6F720709636C61496E6469676F165465787453
          657474696E67732E486F727A416C69676E070643656E74657204546578740604
          4E616D65000000}
      end>
    Left = 56
    Top = 104
  end
  object ScaledLayout1: TScaledLayout
    Align = Client
    OriginalWidth = 960.000000000000000000
    OriginalHeight = 600.000000000000000000
    Size.Width = 960.000000000000000000
    Size.Height = 600.000000000000000000
    Size.PlatformDefault = False
    object Layout1: TLayout
      Align = Client
      Size.Width = 960.000000000000000000
      Size.Height = 559.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 0
    end
    object Panel1: TPanel
      Align = Top
      Size.Width = 960.000000000000000000
      Size.Height = 41.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 1
      object Button1: TButton
        Position.X = 16.000000000000000000
        Position.Y = 8.000000000000000000
        TabOrder = 12
        Text = 'Close'
        OnClick = Button1Click
      end
    end
  end
  object GestureManager1: TGestureManager
    Sensitivity = 80.000000000000000000
    Left = 160
    Top = 104
  end
end


>>>StyleBook1
object TStyleContainer
  object TScaledLayout
    StyleName = 'ItemStyle'
    OriginalWidth = 219.000000000000000000
    OriginalHeight = 248.000000000000000000
    Margins.Left = 10.000000000000000000
    Margins.Top = 10.000000000000000000
    Margins.Right = 10.000000000000000000
    Margins.Bottom = 10.000000000000000000
    Position.X = 324.000000000000000000
    Position.Y = 110.000000000000000000
    Size.Width = 219.000000000000000000
    Size.Height = 248.000000000000000000
    Size.PlatformDefault = False
    Visible = False
    object TRectangle
      StyleName = 'bg'
      Align = Contents
      Fill.Color = claBeige
      HitTest = False
      Opacity = 0.899999976158142100
      Size.Width = 219.000000000000000000
      Size.Height = 248.000000000000000000
      Size.PlatformDefault = False
      Stroke.Color = claWhite
      XRadius = 3.000000000000000000
      YRadius = 3.000000000000000000
    end
    object TLabel
      StyleName = 'NameStyle'
      Align = Client
      StyledSettings = []
      HitTest = True
      Size.Width = 219.000000000000000000
      Size.Height = 248.000000000000000000
      Size.PlatformDefault = False
      TextSettings.Font.Family = #24494#36719#38597#40657
      TextSettings.Font.Size = 28.000000000000000000
      TextSettings.Font.Style = [fsBold]
      TextSettings.FontColor = claIndigo
      TextSettings.HorzAlign = Center
      Text = 'Name'
    end
  end
end
Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 27, 2016 8:37 PM   in response to: Joes Yuan in response to: Joes Yuan
Please cast votes in the following, in order to fix this bug as soon as possible, thanks.

https://quality.embarcadero.com/browse/RSP-13371
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 29, 2016 12:06 AM   in response to: Joes Yuan in response to: Joes Yuan
Joes Yuan wrote:

Please cast votes in the following, in order to fix this bug as soon as possible, thanks.

https://quality.embarcadero.com/browse/RSP-13371

Your report would be much more valuable if you provided a call stack and the exact error message.

--
Dave Nottage [TeamB]
Delphi Worlds blog: http://www.delphiworlds.com/blog
Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 29, 2016 5:36 PM   in response to: Dave Nottage in response to: Dave Nottage
Call Stack

:774adad8 KERNELBASE.RaiseException + 0x48
System.Rtti.TValue.Cast(???)
System.Rtti.TRttiInstanceProperty.DoSetValue(???,$80578C8)
System.Rtti.TRttiProperty.SetValue($8071650,$80578C8)
FMX.Controls.TStyledControl.StyleDataChanged$367$ActRec.$0$Body(???,???)
FMX.Controls.FindProperty($8071650,'OnClick',TStyledControl.StyleDataChanged$367$ActRec($80578E0) as TPropertyApplyProc)
FMX.Controls.TStyledControl.StyleDataChanged(???,$19F27C)
FMX.Controls.Presentation.TPresentedControl.StyleDataChanged('NameStyle.OnClick',$19F27C)
FMX.Controls.TStyledControl.SetStyleData('NameStyle.OnClick',$19F27C)
FMX.Controls.TStyledControl.ApplyStyle
FMX.Controls.TStyledControl.ApplyStyleLookup
FMX.Controls.Presentation.TPresentedControl.ApplyStyleLookup
FMX.Controls.TStyledControl.PrepareForPaint
FMX.Controls.TControl.PrepareForPaint
FMX.Controls.TControl.PrepareForPaint
FMX.Controls.TControl.PrepareForPaint
FMX.Controls.TStyledControl.PrepareForPaint
FMX.Controls.TControl.PrepareForPaint
FMX.Controls.TControl.PrepareForPaint
FMX.Forms.TCustomForm.PrepareForPaint
FMX.Forms.TCustomForm.PaintRects(???)
FMX.Platform.Win.WMPaint(787394,15,0,0)
FMX.Platform.Win.WndProc(787394,15,0,0)
FMX.Platform.Win.TPlatformWin.HandleMessage
FMX.Platform.Win.TPlatformWin.Run
FMX.Forms.TApplication.Run
Project1.Project1
:00702aba TPresentedControl.ApplyStyleLookup + $26

Event Log, Error Message at the last line.

Thread Start: Thread ID: 5936. Process Project1.exe (6916)
Process Start: D:\tmp\ex1\Win32\Debug\Project1.exe. Base Address: $00400000. Process Project1.exe (6916)
Module Load: Project1.exe. Has Debug Info. Base Address: $00400000. Process Project1.exe (6916)
Module Load: ntdll.dll. No Debug Info. Base Address: $77570000. Process Project1.exe (6916)
Module Load: KERNEL32.dll. No Debug Info. Base Address: $75CA0000. Process Project1.exe (6916)
Module Load: KERNELBASE.dll. No Debug Info. Base Address: $773F0000. Process Project1.exe (6916)
Module Load: apphelp.dll. No Debug Info. Base Address: $6EB20000. Process Project1.exe (6916)
Module Load: OLEAUT32.dll. No Debug Info. Base Address: $77350000. Process Project1.exe (6916)
Module Load: msvcrt.dll. No Debug Info. Base Address: $770A0000. Process Project1.exe (6916)
Thread Start: Thread ID: 5532. Process Project1.exe (6916)
Module Load: combase.dll. No Debug Info. Base Address: $75990000. Process Project1.exe (6916)
Module Load: RPCRT4.dll. No Debug Info. Base Address: $76EF0000. Process Project1.exe (6916)
Module Load: SspiCli.dll. No Debug Info. Base Address: $74280000. Process Project1.exe (6916)
Module Load: CRYPTBASE.dll. No Debug Info. Base Address: $74270000. Process Project1.exe (6916)
Module Load: bcryptPrimitives.dll. No Debug Info. Base Address: $766C0000. Process Project1.exe (6916)
Thread Start: Thread ID: 7884. Process Project1.exe (6916)
Module Load: SECHOST.dll. No Debug Info. Base Address: $75940000. Process Project1.exe (6916)
Thread Start: Thread ID: 812. Process Project1.exe (6916)
Module Load: ADVAPI32.dll. No Debug Info. Base Address: $764D0000. Process Project1.exe (6916)
Module Load: USER32.dll. No Debug Info. Base Address: $75B50000. Process Project1.exe (6916)
Module Load: GDI32.dll. No Debug Info. Base Address: $77160000. Process Project1.exe (6916)
Module Load: NETAPI32.dll. No Debug Info. Base Address: $75830000. Process Project1.exe (6916)
Module Load: ole32.dll. No Debug Info. Base Address: $76730000. Process Project1.exe (6916)
Module Load: SHFOLDER.dll. No Debug Info. Base Address: $64740000. Process Project1.exe (6916)
Module Load: VERSION.dll. No Debug Info. Base Address: $74030000. Process Project1.exe (6916)
Module Load: SHELL32.dll. No Debug Info. Base Address: $74410000. Process Project1.exe (6916)
Module Load: CFGMGR32.dll. No Debug Info. Base Address: $77060000. Process Project1.exe (6916)
Module Load: COMDLG32.dll. No Debug Info. Base Address: $75ED0000. Process Project1.exe (6916)
Module Load: Windows.Storage.dll. No Debug Info. Base Address: $75FD0000. Process Project1.exe (6916)
Module Load: SHCORE.dll. No Debug Info. Base Address: $772C0000. Process Project1.exe (6916)
Module Load: SHLWAPI.dll. No Debug Info. Base Address: $76C30000. Process Project1.exe (6916)
Module Load: AppCore.dll. No Debug Info. Base Address: $766B0000. Process Project1.exe (6916)
Module Load: COMCTL32.dll. No Debug Info. Base Address: $73D50000. Process Project1.exe (6916)
Module Load: FirewallAPI.dll. No Debug Info. Base Address: $76FA0000. Process Project1.exe (6916)
Module Load: POWRPROF.dll. No Debug Info. Base Address: $75DE0000. Process Project1.exe (6916)
Module Load: profapi.dll. No Debug Info. Base Address: $76670000. Process Project1.exe (6916)
Module Load: WINMM.dll. No Debug Info. Base Address: $6E5F0000. Process Project1.exe (6916)
Module Load: WINSPOOL.DRV. No Debug Info. Base Address: $71B90000. Process Project1.exe (6916)
Module Load: d3d9.dll. No Debug Info. Base Address: $6C550000. Process Project1.exe (6916)
Module Load: DAVHLPR.dll. No Debug Info. Base Address: $73030000. Process Project1.exe (6916)
Module Load: WINMMBASE.dll. No Debug Info. Base Address: $6E410000. Process Project1.exe (6916)
Module Load: bcrypt.dll. No Debug Info. Base Address: $74190000. Process Project1.exe (6916)
Module Load: dwmapi.dll. No Debug Info. Base Address: $6D890000. Process Project1.exe (6916)
Module Load: WINMMBASE.dll. No Debug Info. Base Address: $001D0000. Process Project1.exe (6916)
Module Unload: WINMMBASE.dll. Process Project1.exe (6916)
Module Load: IMM32.dll. No Debug Info. Base Address: $76680000. Process Project1.exe (6916)
Module Load: fwbase.dll. No Debug Info. Base Address: $72EC0000. Process Project1.exe (6916)
Module Load: wkscli.dll. No Debug Info. Base Address: $741D0000. Process Project1.exe (6916)
Module Load: CSCAPI.dll. No Debug Info. Base Address: $647F0000. Process Project1.exe (6916)
Module Load: UxTheme.dll. No Debug Info. Base Address: $71A60000. Process Project1.exe (6916)
Module Load: MSCTF.dll. No Debug Info. Base Address: $76550000. Process Project1.exe (6916)
Module Load: gdiplus.dll. No Debug Info. Base Address: $718F0000. Process Project1.exe (6916)
Thread Start: Thread ID: 8092. Process Project1.exe (6916)
Thread Start: Thread ID: 7508. Process Project1.exe (6916)
Thread Start: Thread ID: 4736. Process Project1.exe (6916)
Thread Start: Thread ID: 7244. Process Project1.exe (6916)
Module Load: CLBCatQ.DLL. No Debug Info. Base Address: $75850000. Process Project1.exe (6916)
Module Load: DataExchange.dll. No Debug Info. Base Address: $66F30000. Process Project1.exe (6916)
Module Load: d3d11.dll. No Debug Info. Base Address: $689E0000. Process Project1.exe (6916)
Module Load: dcomp.dll. No Debug Info. Base Address: $66F80000. Process Project1.exe (6916)
Module Load: dxgi.dll. No Debug Info. Base Address: $68950000. Process Project1.exe (6916)
Module Load: twinapi.appcore.dll. No Debug Info. Base Address: $66E60000. Process Project1.exe (6916)
Module Load: d3d10_1.dll. No Debug Info. Base Address: $67110000. Process Project1.exe (6916)
Module Load: d3d10_1core.dll. No Debug Info. Base Address: $670B0000. Process Project1.exe (6916)
Module Unload: d3d10_1core.dll. Process Project1.exe (6916)
Module Unload: d3d10_1.dll. Process Project1.exe (6916)
Module Load: d3d10_1.dll. No Debug Info. Base Address: $67110000. Process Project1.exe (6916)
Module Load: d3d10_1core.dll. No Debug Info. Base Address: $670B0000. Process Project1.exe (6916)
Module Load: RMCLIENT.dll. No Debug Info. Base Address: $5D480000. Process Project1.exe (6916)
Module Unload: RMCLIENT.dll. Process Project1.exe (6916)
Module Load: igd10iumd32.dll. No Debug Info. Base Address: $67E90000. Process Project1.exe (6916)
Module Load: ncrypt.dll. No Debug Info. Base Address: $6C400000. Process Project1.exe (6916)
Module Load: NTASN1.dll. No Debug Info. Base Address: $6C260000. Process Project1.exe (6916)
Module Load: igdusc32.dll. No Debug Info. Base Address: $675D0000. Process Project1.exe (6916)
Module Unload: igdusc32.dll. Process Project1.exe (6916)
Module Unload: NTASN1.dll. Process Project1.exe (6916)
Module Unload: ncrypt.dll. Process Project1.exe (6916)
Module Unload: igd10iumd32.dll. Process Project1.exe (6916)
Module Load: igd10iumd32.dll. No Debug Info. Base Address: $67E90000. Process Project1.exe (6916)
Module Load: ncrypt.dll. No Debug Info. Base Address: $6C400000. Process Project1.exe (6916)
Module Load: NTASN1.dll. No Debug Info. Base Address: $6C260000. Process Project1.exe (6916)
Module Load: igdusc32.dll. No Debug Info. Base Address: $675D0000. Process Project1.exe (6916)
Module Load: d2d1.dll. No Debug Info. Base Address: $67140000. Process Project1.exe (6916)
Module Load: DWrite.dll. No Debug Info. Base Address: $69220000. Process Project1.exe (6916)
Module Load: WindowsCodecs.dll. No Debug Info. Base Address: $645C0000. Process Project1.exe (6916)
Thread Start: Thread ID: 8052. Process Project1.exe (6916)
Thread Start: Thread ID: 5064. Process Project1.exe (6916)
Thread Start: Thread ID: 4744. Process Project1.exe (6916)
Thread Start: Thread ID: 1120. Process Project1.exe (6916)
Thread Start: Thread ID: 3592. Process Project1.exe (6916)
Thread Start: Thread ID: 4748. Process Project1.exe (6916)
Thread Start: Thread ID: 6948. Process Project1.exe (6916)
Thread Start: Thread ID: 4176. Process Project1.exe (6916)
Module Load: rtscom.dll. No Debug Info. Base Address: $5D470000. Process Project1.exe (6916)
Module Load: inkobj.dll. No Debug Info. Base Address: $5D2E0000. Process Project1.exe (6916)
Thread Start: Thread ID: 4544. Process Project1.exe (6916)
Thread Start: Thread ID: 5812. Process Project1.exe (6916)
Thread Start: Thread ID: 7940. Process Project1.exe (6916)
Module Load: mshwgst.dll. No Debug Info. Base Address: $5D2D0000. Process Project1.exe (6916)
Module Load: atlthunk.dll. No Debug Info. Base Address: $5BF10000. Process Project1.exe (6916)
Module Load: atlthunk.dll. No Debug Info. Base Address: $0AD80000. Process Project1.exe (6916)
Module Unload: atlthunk.dll. Process Project1.exe (6916)
Module Load: Wisp.DLL. No Debug Info. Base Address: $5D290000. Process Project1.exe (6916)
Thread Start: Thread ID: 7316. Process Project1.exe (6916)
Thread Start: Thread ID: 4032. Process Project1.exe (6916)
Module Load: TpcPS.DLL. No Debug Info. Base Address: $5D280000. Process Project1.exe (6916)
Module Load: AVRT.dll. No Debug Info. Base Address: $648E0000. Process Project1.exe (6916)
Thread Start: Thread ID: 7580. Process Project1.exe (6916)
Thread Start: Thread ID: 6872. Process Project1.exe (6916)
Thread Start: Thread ID: 3580. Process Project1.exe (6916)
Thread Start: Thread ID: 7744. Process Project1.exe (6916)
Thread Start: Thread ID: 5932. Process Project1.exe (6916)
Thread Start: Thread ID: 7200. Process Project1.exe (6916)
Thread Start: Thread ID: 6468. Process Project1.exe (6916)
Thread Start: Thread ID: 5708. Process Project1.exe (6916)
First chance exception at $774ADAD8. Exception class EInvalidCast with message 'Invalid class typecast'. Process Project1.exe (6916)

Dave Nottage wrote:
Joes Yuan wrote:

Please cast votes in the following, in order to fix this bug as soon as possible, thanks.

https://quality.embarcadero.com/browse/RSP-13371

Your report would be much more valuable if you provided a call stack and the exact error message.

--
Dave Nottage [TeamB]
Delphi Worlds blog: http://www.delphiworlds.com/blog
Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 17, 2016 5:59 PM   in response to: Joes Yuan in response to: Joes Yuan
Who can test if this bug fixed in Delphi XE 10.1 ? Thanks.
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2016 11:51 AM   in response to: Joes Yuan in response to: Joes Yuan
Joes Yuan wrote:
Who can test if this bug fixed in Delphi XE 10.1 ? Thanks.

Even if they can they can't report back without violating their NDA.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2016 2:13 PM   in response to: Joes Yuan in response to: Joes Yuan
Am 18.04.2016 um 02:59 schrieb Joes Yuan:
Who can test if this bug fixed in Delphi XE 10.1 ? Thanks.

Hello,

if you're on SA you can log a case in customer maintenance portal (as
you have 3 incidents per year) and EMBT will contact you directly about
your issue.

Greetings

Markus

Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2016 5:37 PM   in response to: Markus Humm in response to: Markus Humm
fixed in xe10.1.

Markus Humm wrote:
Am 18.04.2016 um 02:59 schrieb Joes Yuan:
Who can test if this bug fixed in Delphi XE 10.1 ? Thanks.

Hello,

if you're on SA you can log a case in customer maintenance portal (as
you have 3 incidents per year) and EMBT will contact you directly about
your issue.

Greetings

Markus

Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2016 5:08 AM   in response to: Joes Yuan in response to: Joes Yuan
Joes Yuan wrote:

fixed in xe10.1.

<sigh>


--
Rudy Velthuis http://www.rvelthuis.de

"It is better to be feared than loved, if you cannot be both."
-- Niccolo Machiavelli (1469-1527), "The Prince"

Joes Yuan

Posts: 45
Registered: 9/23/05
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2016 5:40 PM   in response to: Joes Yuan in response to: Joes Yuan
fixed in XE10.1
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: [XE10] Need Help. When scroll or pan, show error "Invalid class typecast".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2016 7:29 PM   in response to: Joes Yuan in response to: Joes Yuan
Joes Yuan wrote:

fixed in XE10.1

<sigh> There is no XE10.1.

It is called 10.1 Berlin. No XE in the name (and yes, I am aware of the
migration manager).

Using XE is very confusing, since some older texts call the version
after XE8 XE9 (that would be 10 Seattle) and the version after that
XE10 (that would be 10.1 Berlin). So, if you want to avoid confusion,
do not use the XE name anymore for versions released after XE8.

--
Rudy Velthuis http://www.rvelthuis.de

"You don't have to brush your teeth - just the ones you want
to keep." -- Unknown
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02