Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-06

how to find this error?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

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 ? Thank you

Reply by email

Tony Whyman
to FreeMan

Take a look at

http://wiki.freepascal.org/Lazarus_known_issues_%28things_that_will_never_be_fixed%29#TStatusBar_Panels_2

It's probably one of those annoying TStatusBar (won't fix) issues.

FreeMan wrote 23 lines
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 ? Thank you -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

zeljko
to FreeMan: fpc r31177 lazarus r49465 qt x64 osx my project work in osx qt64, win32 i386 qt is workas…
FreeMan wrote 15 lines
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

Reply by email

FreeMan
to Tony Whyman: Take a look at http://wiki.freepascal.org/Lazarus_known_issues_%28things_that_will_never_b…

Thank you,
I remove TStarusBar and codes, I add TPanel and TBCLabel on that panel. view been much better status bar. This is good for me, but I didn't find error when myform.show; I'm still investigation. I need to trace formshow, I wish, compiler give any tips about class or filename or line number so easy find problem

Tony Whyman wrote 24 lines
Take a look at http://wiki.freepascal.org/Lazarus_known_issues_%28things_that_will_never_be_fixed%29#TStatusBar_Panels_2 It's probably one of those annoying TStatusBar (won't fix) issues. On 29/06/15 10:43, 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 ? > Thank you

Reply by email

FreeMan
to zeljko: TStatusBar.Canvas.TextWidth() needs Canvas.Handle when you use it. Canvas.Handle isn't…
zeljko wrote 24 lines
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

Reply by email