Statusbar array dimensioning error?

Started by Eddy Van Esch, February 17, 2014, 12:01:43 PM

Previous topic - Next topic

Eddy Van Esch

Paul,

Could I still get a little bit of your attention concerning FF?  ;D

I have a bug in my project, so I turned on
#DEBUG ERROR ON
#DEBUG DISPLAY ON

to get some untrapped errors shown.

When I compiled and ran, I got an "Error 9 - Subscript / Pointer out of range"

I found that in the FF generated source code files, this line is generated:
Dim FLY_StatusParts(1 to 0) As Long
(notice the subscript "(1 to 0)" ) in this snippet:

    ' Handle the sizing of any toolbars/statusbars
    If wMsg = %WM_SIZE Then                     

        ' Resize the StatusBar if one is present
        If wParam <> %SIZE_MINIMIZED Then
           If IsWindow(GetDlgItem( hWndForm, IDC_TBMAIN_STATUSBAR) ) Then
              SendMessage GetDlgItem( hWndForm, IDC_TBMAIN_STATUSBAR), wMsg, wParam, lParam
              GetClientRect GetDlgItem( hWndForm, IDC_TBMAIN_STATUSBAR), FLY_Rect
              Dim FLY_StatusParts( 1 to 0 ) As Long
              FLY_nResult = 0  ' use to accumulate the panel width total
              SendMessage GetDlgItem( hWndForm, IDC_TBMAIN_STATUSBAR), %SB_SETPARTS, 0, VarPtr(FLY_StatusParts(1))
              FLY_nResult = 0
           End If
        End If
...

Could you give me a tip on how to work around this?

Kind regards
Eddy

Paul Squires

How do you have your status bar defined? Simple or Panels? If Panels, then maybe define one panel and make it full width autosize?
Paul Squires
PlanetSquires Software

Eddy Van Esch

I have them defined as 'Style: 0 - Normal'. Simple text enabled.
In tab 'Panels' I have nothing defined.
I will try playing around with this.
Eddy

Eddy Van Esch

Paul,

I changed statusbar style to '1 - Simple', no entries on the 'Panels' tab, then changed:
FF_StatusBar_SetText( HWND_TBSCREENER_STATUSBAR, 255, sTxt, 0 )
to
FF_StatusBar_SetText( HWND_TBSCREENER_STATUSBAR, 0, sTxt, 0 )
and that seems to work okay now.
Thank you!
Eddy