PalBmpLoad() not returning an array.

PalBmpLoad() not returning an array.

Postby concentra » Thu Feb 05, 2009 1:50 pm

I have an application that loads small bitmaps in buttons using TBtnBmp().
Sometimes the LoadBitmaps() method crashes loading the bitmap because PalBmpLoad() returns an invalid handle ( big negative numeric ) and it is supposed to return an array, causing an "array access" error !
The bitmaps are coded directly in RCs and appended to the EXE, no DLLs, so the bitmaps are there for sure.
The weird is that it never crashes the first time the bitmap is loaded, only after it is loaded at least one time, and not always happens, sometimes the 2nd time, sometimes 3rd or 4th... I some machines it never hapens !
It seems to me that Windows is "discarding" the bitmap after the first load in order to free memory.
Am I correct ?
How can I avoid it ?

Maurício Faria
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: PalBmpLoad() not returning an array.

Postby Antonio Linares » Thu Feb 05, 2009 2:21 pm

Mauricio,

Could you please post here the error.log file that you get on those cases ? thanks

PalBmpLoad() should return an array always.
regards, saludos

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

Re: PalBmpLoad() not returning an array.

Postby concentra » Fri Feb 06, 2009 12:20 pm

Antônio, the app was linked using FWH version August 2008.


Application
===========
Path and name: C:\PCECFG\FARMA.EXE (32 bits)
Size: 4,013,568 bytes
Time from start: 0 hours 0 mins 7 secs
Error occurred at: 05/02/09, 16:48:21
Error description: Error BASE/1068 Argument error: array access
Args:
[ 1] = N 67633716
[ 2] = N 1

Stack Calls
===========
Called from: btnbmp.prg => TBTNBMP:LOADBITMAPS(624)
Called from: btnbmp.prg => TBTNBMP:NEWBAR(298)
Called from: SPadrao.prg => CRIATELA(695)
Called from: SPadrao.prg => (b)PADRAOBROWSE(502)
Called from: dialog.prg => TDIALOG:INITIATE(700)
Called from: dialog.prg => TDIALOG:HANDLEEVENT(901)
Called from: => DIALOGBOXINDIRECT(0)
Called from: dialog.prg => TDIALOG:ACTIVATE(270)
Called from: SPadrao.prg => PADRAOBROWSE(502)
Called from: FAR424.PRG => QUALIFICACAO(872)
Called from: FAR424.PRG => (b)FAR424(114)
Called from: button.prg => TBUTTON:CLICK(172)
Called from: control.prg => TBUTTON:HANDLEEVENT(1390)
Called from: window.prg => _FWH(3300)
Called from: => SENDMESSAGE(0)
Called from: dialog.prg => TDIALOG:COMMAND(404)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: dialog.prg => TDIALOG:HANDLEEVENT(917)
Called from: => DIALOGBOX(0)
Called from: dialog.prg => TDIALOG:ACTIVATE(270)
Called from: FAR424.PRG => FAR424(125)
Called from: FAR000.PRG => (b)FAR000(180)
Called from: FAR000.PRG => FAR000(186)
Called from: FAR000.PRG => MAIN(87)

System
======
CPU type: Intel(R) Pentium(R) 4 CPU 3.00GHz 3000 Mhz
Hardware memory: 512 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 1.0.0 Intl. (SimpLex)
Windows version: 5.0, Build 2195 Service Pack 4

Windows total applications running: 15
1
2 NetDDE Agent
3 Question rio de qualifica‡Æo de fornecedor
4 Controle de qualifica‡Æo de fornecedores
5 C:\PCECFG\PCE000.EXE
6 {A7E495BF-9589-4a6e-8479-DDA2D8D3C05F}
7 OfficeScan Client
8 BascsTrayD
9 Apache Service Monitor
10 Medidor de energia
11 Connections Tray
12 MS_WebcheckMonitor
13 DDE Server Window
14 CB Monitor Window
15 Program Manager

Variables in use
================
Procedure Type Value
==========================
TBTNBMP:LOADBITMAPS
Param 1: C "btnAlterar"
Param 2: C "btnAlterar_"
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Local 1: O Class: TBTNBMP
Local 2: N 67633716
Local 3: U
Local 4: O Class: TBTNBMP
Local 5: N 67633716
Local 6: N 1
Local 7: U
Local 8: N 0
TBTNBMP:NEWBAR
Param 1: C "btnAlterar"
Param 2: C "btnAlterar_"
Param 3: U
Param 4: U
Param 5: C ""
Param 6: B {|| ... }
Param 7: L .F.
Param 8: O Class: TBAR
Param 9: L .F.
Param 10: U
Param 11: C "Alterar resposta"
Param 12: L .F.
Param 13: U
Param 14: C "aBotoes[ nInd , _ACTION ]"
Param 15: U
Param 16: C "Resposta"
Param 17: U
Param 18: U
Param 19: U
Param 20: L .F.
Param 21: U
Param 22: C "TOP"
Local 1: O Class: TBTNBMP
CRIATELA
Param 1: O Class: TDIALOG
Param 2: O Class: TCONCBROWSE
Param 3: C "Question rio de qualifica‡Æo de fornecedor"
Param 4: C "DB_TECLAS"
Param 5: C "ARRAY"
Param 6: A Len: 2
Param 7: A Len: 3
Param 8: A Len: 3
Param 9: A Len: 4
Param 10: A Len: 3
Param 11: U
Param 12: L .F.
Param 13: C "ENTER-Altera nota F3-Grava altera‡äes ESC-Sair"
Param 14: A Len: 3
Param 15: A Len: 2
Param 16: U
Param 17: U
Param 18: B {|| ... }
Param 19: B {|| ... }
Param 20: A Len: 1
Param 21: A Len: 0
Param 22: U
Param 23: L .F.
Param 24: A Len: 0
Param 25: C ""
Param 26: A Len: 0
Param 27: L .F.
Param 28: O Class: TFONT
Param 29: A Len: 3
Param 30: U
Param 31: U
Local 1: N 1
Local 2: A Len: 0
Local 3: O Class: TBAR
Local 4: U
Local 5: O Class: TMSGBAR
Local 6: N 0
Local 7: L .F.
Local 8: A Len: 2
Local 9: A Len: 0
Local 10: U
Local 11: C ""
Local 12: N 0
Local 13: N 0
Local 14: A Len: 0
Local 15: U
Local 16: U
(b)PADRAOBROWSE
Param 1: O Class: TDIALOG
TDIALOG:INITIATE
Param 1: N 131240
Param 2: N 131234
Local 1: O Class: TDIALOG
Local 2: L .T.
Local 3: U
Local 4: U
Local 5: L .F.
Local 6: U
TDIALOG:HANDLEEVENT
Param 1: N 272
Param 2: N 131240
Param 3: N 131234
Local 1: O Class: TDIALOG
DIALOGBOXINDIRECT
Param 1: N 4194304
Param 2: C "? Ø?  ô˜Š˜, Q u e s t i o n á r i o d e q u a l i f i c a ç ã o d e f o r n e c e d o r  ?P Q'j T C O N C B R O W S E "
Param 3: N 262274
Param 4: O Class: TDIALOG
TDIALOG:ACTIVATE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .F.
Param 5: B {|| ... }
Param 6: L .T.
Param 7: B {|| ... }
Param 8: U
Param 9: U
Param 10: L .F.
Local 1: O Class: TDIALOG
Local 2: N 262274
Local 3: U
Local 4: U
Local 5: U
Local 6: O Class: TDIALOG
PADRAOBROWSE
Param 1: O Class: TDIALOG
Param 2: O Class: TCONCBROWSE
Local 1: C "Question rio de qualifica‡Æo de fornecedor"
Local 2: C "DB_TECLAS"
Local 3: C "ARRAY"
Local 4: A Len: 2
Local 5: A Len: 3
Local 6: A Len: 3
Local 7: A Len: 4
Local 8: A Len: 3
Local 9: U
Local 10: L .F.
Local 11: C "ENTER-Altera nota F3-Grava altera‡äes ESC-Sair"
Local 12: A Len: 3
Local 13: A Len: 2
Local 14: U
Local 15: U
Local 16: B {|| ... }
Local 17: B {|| ... }
Local 18: A Len: 1
Local 19: A Len: 0
Local 20: U
Local 21: L .F.
Local 22: A Len: 0
Local 23: C ""
Local 24: A Len: 0
Local 25: L .F.
Local 26: O Class: TFONT
Local 27: A Len: 3
Local 28: U
Local 29: U
Local 30: C "ACE264"
Local 31: U
Local 32: N 4
Local 33: B {|| ... }
Local 34: U
Local 35: U
Local 36: U
Local 37: U
Local 38: U
Local 39: U
QUALIFICACAO
Local 1: U
Local 2: U
Local 3: A Len: 2
Local 4: A Len: 3
Local 5: A Len: 3
Local 6: A Len: 4
Local 7: A Len: 3
(b)FAR424
TBUTTON:CLICK
Local 1: O Class: TBUTTON
TBUTTON:HANDLEEVENT
Param 1: N 2048
Param 2: N 0
Param 3: N 0
Local 1: O Class: TBUTTON
Local 2: U
_FWH
Param 1: N 0
Param 2: N 2048
Param 3: N 0
Param 4: N 0
Param 5: N 6
Local 1: O Class: TBUTTON
SENDMESSAGE
Param 1: N 65684
Param 2: N 2048
Param 3: N 0
Param 4: N 0
TDIALOG:COMMAND
Param 1: N 3
Param 2: N 65684
Local 1: O Class: TDIALOG
Local 2: O Class: TBUTTON
Local 3: N 0
Local 4: N 3
Local 5: N 65684
TWINDOW:HANDLEEVENT
Param 1: N 273
Param 2: N 3
Param 3: N 65684
TDIALOG:HANDLEEVENT
Param 1: N 273
Param 2: N 3
Param 3: N 65684
Local 1: O Class: TDIALOG
DIALOGBOX
Param 1: N 4194304
Param 2: N 4243
Param 3: N 0
Param 4: O Class: TDIALOG
TDIALOG:ACTIVATE
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: L .F.
Local 1: O Class: TDIALOG
Local 2: N 0
Local 3: U
Local 4: U
Local 5: U
Local 6: O Class: TDIALOG
FAR424
Param 1: C "00023"
Param 2: O Class: TDIALOG
Param 3: O Class: TBUTTON
Param 4: O Class: TBUTTON
Param 5: O Class: TBUTTON
Param 6: O Class: TCOMBOBOX
Param 7: O Class: TRADMENU
Param 8: O Class: TGET
Param 9: O Class: TWBROWSE
Param 10: O Class: TBUTTON
Local 1: O Class: TBUTTON
Local 2: C " "
Local 3: A Len: 468
Local 4: A Len: 468
Local 5: C "DEG "
Local 6: N 115
Local 7: B {|| ... }
Local 8: A Len: 4
Local 9: A Len: 4
Local 10: A Len: 4
Local 11: N 1
(b)FAR000
FAR000
Param 1: C "SUPERVISOR"
Param 2: B {|| ... }
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Local 1: U
Local 2: U
Local 3: U
Local 4: N 150601728
Local 5: N 11
Local 6: U
Local 7: U
Local 8: L .F.
MAIN
Param 1: C "SUPERVISOR"
Param 2: C "FAR424"
Local 1: U
Local 2: U
Local 3: U
Local 4: U
Local 5: U
Local 6: U
Local 7: U
Local 8: U
Local 9: U
Local 10: U

Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX

DataBases in use
================

1: ACE020 RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
25 3560 .F. .F.

Indexes in use TagName
PED_NUM+PED_FOR ICE020
=> PED_FOR+PED_NUM ICE0201
PED_DAT ICE0202
PED_DVE ICE0203
PED_NUM+PED_FOR ICE0204
FOR_FAN ICE0205
PED_NUM+PED_FOR ICE020S
PED_DAT ICE0202S
FOR_FAN ICE0205S
PED_NUM+PED_FOR ICE020N
PED_DAT ICE0202N
FOR_FAN ICE0205N
PED_FOR+PED_NUM ICE0207N
PED_FOR + PED_DOC ICE0206
PED_TR_FIL ICE0208

Relations in use

2: ACE021 RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
19320 22669 .F. .F.

Indexes in use TagName
=> CPE_NUM+CPE_COD ICE021
CPE_COD ICE0211
CPE_NUM+PRO_DES ICE0212
CPE_NUM ICE0213

Relations in use

3: ACE008 RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
15 467 .F. .F.

Indexes in use TagName
FOR_COD ICE008
=> FOR_FAN ICE018
STR( FOR_IND_AL , 1 ) ICE028
FOR_CGC ICE0083
FOR_RAZ ICE0084
FOR_CID ICE0085

Relations in use

4: ACE003 RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
1 5539 .F. .F.

Indexes in use TagName
PRO_COD ICE003
PRO_DES ICE013
PRO_COD ICE0031
PRO_COD ICE0032
PRO_COD ICE0033
PRO_COD ICE0034
PRO_COD ICE0035
PRO_BARRA ICE0036
PRO_C_SIN ICE0037
PRO_COD ICE0038
PRO_COD ICE0039
PRO_DES ICE00310
PRO_FAM+LEFT(PRO_SUB,2)+PRO_DES ICE00311
PRO_COD+PRO_LOTE ICE00312
PRO_COD ICE00313

Relations in use

5: ACE259 RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
2 1 .F. .T.

Indexes in use TagName
=> QAF_COD ICE2590

Relations in use

6: => ACE264 RddName: DBFCDX
==============================
RecNo RecCount BOF EOF
4 17 .F. .F.

Indexes in use TagName
=> RESP_CODFR + RESP_CODPE ICE2640
RESP_CODPE ICE2641

Relations in use

Classes in use:
===============
1 HASHENTRY
2 HBCLASS
3 HBOBJECT
4 TWINDOW
5 TDIALOG
6 TBRUSH
7 TCONTROL
8 TWBROWSE
9 TCOMBOBOX
10 TGET
11 GET
12 TCLIPGET
13 TBUTTON
14 TRADMENU
15 TRADIO
16 TFONT
17 TSCROLLBAR
18 TSBROWSE
19 TCONCBROWSE
20 TBITMAP
21 ERROR
22 TSBSCRLBAR
23 TSCOLUMN
24 TMSGBAR
25 TRECT
26 TBAR
27 TBTNBMP
28 TREG32

Memory Analysis
===============
245 Static variables

Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
User avatar
concentra
 
Posts: 124
Joined: Mon Nov 14, 2005 10:15 am
Location: Brazil

Re: PalBmpLoad() not returning an array.

Postby Antonio Linares » Fri Feb 06, 2009 1:39 pm

Mauricio,

We have checked FWH source code for PalBmpLoad() and it is fine in the FWH version that you use.

You are using an older xHarbour build:
Compiler version: xHarbour build 1.0.0 Intl. (SimpLex)

I would suggest you to use the current xHarbour build that we provide from here:
http://www.fivetechsoft.com/files/xharbour.exe
xHarbour Compiler build 1.1.0 (SimpLex) (Rev. 6195)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests