BtnBMP Error

BtnBMP Error

Postby PeterHarmes » Thu Dec 06, 2007 9:46 am

Hi,

I'm getting the error below at a customers site:

Application
===========
Path and name: S:\winiws5\Allocinv.EXE (32 bits)
Size: 2,813,952 bytes
Time from start: 0 hours 0 mins 11 secs
Error occurred at: 06/12/2007, 09:24:36
Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = N 1007158280
[ 2] = N 1

Stack Calls
===========
Called from: BTNBMP.PRG => TBTNBMP:LOADBITMAPS(0)
Called from: BTNBMP.PRG => TBTNBMP:NEWBAR(0)
Called from: COMMON.PRG => CONFPOPBAR(3228)
Called from: POPUP.PRG => (b)CUST_LIST(292)
Called from: DIALOG.PRG => TDIALOG:INITIATE(682)
Called from: DIALOG.PRG => TDIALOG:HANDLEEVENT(832)
Called from: => DIALOGBOX(0)
Called from: DIALOG.PRG => TDIALOG:ACTIVATE(262)
Called from: POPUP.PRG => CUST_LIST(292)
Called from: REPRANGE.PRG => RANGEPOP(156)
Called from: REPRANGE.PRG => (b)RANGE_SEL(111)
Called from: BTNBMP.PRG => TBTNBMP:CLICK(0)
Called from: BTNBMP.PRG => TBTNBMP:LBUTTONUP(0)
Called from: WINDOW.PRG => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TBTNBMP:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => DIALOGBOX(0)
Called from: DIALOG.PRG => TDIALOG:ACTIVATE(262)
Called from: REPRANGE.PRG => RANGE_SEL(123)
Called from: => GETRANGES(276)
Called from: ALLOCINV.PRG => MAIN(85)

This error occurs when a dialog box is opened for the second time. Also, we think that this error only occurs when the application is run through a remote desktop connection.

I'm currently using the may 2007 build of fivewin with commercial xHarbour.

Could anyone have a look at the error and try and point me in the right directions?

Many Thanks

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Postby Antonio Linares » Thu Dec 06, 2007 11:24 am

Peter,

>
Also, we think that this error only occurs when the application is run through a remote desktop connection.
>

Its a quite strange error, because the C functions used in Method LoadBitmaps() always return an array, and in your error that array, somehow, has turned into a number (memory corruption?)

Anyhow, what you can do is to protect that method to avoid the error, this way:
Code: Select all  Expand view
   if ! Empty( cResName1 )
      aBmpPal = PalBmpLoad( cResName1 )
      if ValType( aBmpPal ) == "A"
         ::hBitmap1  = aBmpPal[ 1 ]
         ::hPalette1 = aBmpPal[ 2 ]
      endif
   endif

and do that for each use of aBmpPal in the method
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby PeterHarmes » Thu Dec 06, 2007 2:29 pm

Thanks Antonio,

That has prevented the error message. I have now noticed that it is always the same bmp that is missing (which is what i'm assuming is causing the error) Could there be a problem with the resource file? - the bitmap used is contained in a resource file.

Also, what do we do from now on? Will i have to make the change you mention to all future versions of fivewin or will this be incorporated into future releases?

As i've found what part of the code is causing the error, is there anything i can do to give you any more info on why this is occurring? The code that uses the bitmap is:

DEFINE BUTTON OF oBar RESOURCE "TOP" NOBORDER GROUP ACTION (CursorWait(), oBrw:GoTop(), oBrw:SetFocus(), CursorArrow()) TOOLTIP "Top"

Thanks for your help

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Postby Antonio Linares » Thu Dec 06, 2007 5:06 pm

Pete,

Please email me the bitmap file

What FWH version are you using ?

We can include such source code change in FWH source code, though we would like to understand and locate where the error is coming from
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby PeterHarmes » Thu Dec 13, 2007 2:42 pm

Antonio,

Thanks for the reply - just sent you an email.

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi and 85 guests