[Lazarus] how to find this error?

FreeMan freeman35 at delphiturkiye.com
Thu Jul 2 12:50:08 CEST 2015



On 29.06.2015 13:57, zeljko wrote:
> On 06/29/2015 11:43 AM, FreeMan wrote:
>> fpc r31177 lazarus r49465 qt x64 osx
>> my project work in osx qt64, win32 i386 qt is workas well, but in win64
>> qt64 create "access violation" exception on "myform.Show;"
>> on form has a "TStatusBar"
>> I := TStatusBar.Canvas.TextWidth(TStatusBar.Panels[0].Text);
>> this code has create exception in win64 too.
>> when I wrote this message,
>> http://forum.lazarus.freepascal.org/index.php/topic,27706.0.html same
>> form and same my code worked, I mean my code not changed but not working
>> now. I remark this line and re try run under win64, but still raise
>> exception when use myForm.Show;
>> I can not trace this exception, I added onShow event but not trigger.
>> raise exception and terminate application.
>> whats yours suggestion? TStatusBar bar has a bug ?? or what can be
>> problem ?
>
> TStatusBar.Canvas.TextWidth() needs Canvas.Handle when you use it. 
> Canvas.Handle isn't available until there's no paintevent on TQtWidget 
> handle, so that may be problem.
> Try to use temporary bitmap for text measuring and see if it works.
>
> zeljko
>


TPageControl except Error in win64 qt on show, no any error on create.  
"TPageControl.Visible := False;"  I added this in form.oncreate event. 
This form now open without error, but no page control. pagecontrol has a 
"TBCButton" and thats have a just onclick event, they work like a 
menuitem for me. And usually my all forms is inherited from same main 
form. (I added lfm file's code). that create exception too. and just in 
win64. osx qtx64, win32 qt work normally. There is no except error. not 
test in linux yet.

"TPageControl.Visible := False;" I added this code and form is showing. 
after then try close access voilation error except again.

inherited FRM_Main: TFRM_Main
   Left = 412
   Top = 137
   Width = 1175
   ActiveControl = PGC_Menu
   Caption = 'FRM_Main-'
   ClientWidth = 1175
   OnCreate = FormCreate
   OnDestroy = FormDestroy
   OnShow = FormShow
   inherited STAT_Bar: TPanel
     Width = 1175
     Caption = ' '
     ClientWidth = 1175
     inherited L_dbName: TBCLabel
       Width = 891
     end
   end
   inherited PGC_Menu: TPageControl
     Width = 1082
     ActivePage = TBS_GunlukIslemler
     TabIndex = 2
     inherited TBS_System: TTabSheet
       ClientHeight = 120
       ClientWidth = 1075
       inherited BTN_Sys_Settings: TBCButton
         Height = 60
         OnClick = BTN_Sys_SettingsClick
       end
       inherited BTN_Change_db: TBCButton
         Height = 60
       end
       inherited BTN_Update_Prog: TBCButton
         Height = 60
         OnClick = BTN_Update_ProgClick
       end
       inherited BTN_Backup_db: TBCButton
         Left = 491
         Height = 60
         OnClick = BTN_Backup_dbClick
       end
       inherited BTN_User_Perms: TBCButton
         Height = 60
         OnClick = BTN_User_PermsClick
       end
       object BTN_join: TBCButton[5]
         Left = 392
         Height = 62
         Top = 0
         Width = 99
         Align = alLeft





More information about the Lazarus mailing list