f



Access Violation Error in bBrowser

Hi all,

In 99% times that one of my clients report an access violation are
editing this browser,
In debug mode i never have an access violation in this.

CLASS PObBQtdTamDescDecimal INHERIT PObbrowser
	PROTECT auQtd AS ARRAY
	PROTECT auTamanhos AS ARRAY
METHOD Init(oOwner, uID, oOrigin, oDimension, kStyle) CLASS
PObBQtdTamDescDecimal
	LOCAL oabServer AS bArrayServer
	LOCAL auStruct AS ARRAY
	LOCAL auData AS ARRAY
	LOCAL obGrid AS bgrid
	LOCAL obViewStyle AS bViewStyle

    SUPER:Init(oOwner, uID, oOrigin, oDimension, kStyle)

	auStruct:={{"...","C",8,0},{"T1","N",7,2},{"T2","N",7,2},{"T3","N",
7,2},{"T4","N",7,2},{"T5","N",7,2},;
				{"T6","N",7,2},{"T7","N",7,2},{"T8","N",7,2},{"T9","N",7,2},
{"T10","N",7,2},;
				{"T11","N",7,2},{"T12","N",7,2},{"T13","N",7,2},{"T14","N",7,2},
{"T15","N",7,2},;
				{"T16","N",7,2},{"T17","N",7,2},{"T18","N",7,2},{"T19","N",7,2},
{"T20","N",7,2},;
				{"TOTAL","N",9,2}}
	auData:={{"...",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}
	oabServer:=bArrayServer{auStruct,auData}
	SELF:Use(oabServer)
	SELF:Freeze:=1
	obGrid:=SELF:Grid
	obGrid:Foreground:=color{205,205,205}
	obGrid:Flat:=FALSE
	obViewStyle:=bViewStyle{,Brush{Color{156,184,234}},,,obGrid}
	SELF:GetColumn(1):BackGround:=obViewStyle:Background
	SELF:EnableColumnMove(FALSE)
	//Focus
	SELF:FocusView := bFocusStyle{BBS_SOLID,Color{255, 165, 0},2,-2}
	SELF:Redraw
(#Focus,SELF:CurrentColumn,SELF:CurrentRow,SELF:CurrentRecNo)

	SELF:Refresh()



METHOD Notify(kNotifyName, uDescription) CLASS PObBQtdTamDescDecimal
	LOCAL uValue AS USUAL
	uValue := SUPER:Notify(kNotifyName, uDescription)
	//Put your changes here

	IF kNotifyName==NOTIFYRECORDCHANGE
		IF IsMethod(SELF:Owner,#ActivaBrowser)
			Send ( SELF:Owner,#ActivaBrowser )
		ENDIF
	ENDIF
RETURN uValue

METHOD POAppend(cDesc,aQtd) CLASS PObBQtdTamDescDecimal
	LOCAL i AS SHORT
	LOCAL iTotLin AS SHORT

	SUPER:Append()

	SELF:Server:FIELDPUT(1,cDesc)
	iTotLin:=0
	FOR i:=2 TO 21
		SELF:Server:FIELDPUT(i,aQtd[i-1])
		iTotLin+=aQtd[i-1]
	NEXT i
	SELF:Server:FIELDPUT(22,iTotLin)

METHOD POCaptionTam(cDesc,aTam) CLASS PObBQtdTamDescDecimal
	LOCAL i AS SHORT

	SELF:GetColumn(1):Caption:=cDesc
	FOR i:=2 TO 21
		SELF:GetColumn(i):Caption:=aTam[i-1]
	NEXT i



METHOD CellEdit(oCellEditEvent) CLASS dtwmanutEncomendasSOVSQL
	LOCAL i AS SHORT
	LOCAL iTot AS INT

	DO CASE
		CASE oCellEditEvent:EditMode = BEDIT_COMMIT
			iTot:=0
			FOR i:=1 TO 20
				iTot+=SELF:oDCbBQtdtam:Server:FIELDGET(i+1)
			NEXT i
			SELF:oDCbBQtdtam:Server:FIELDPUT(22,iTot*SELF:oDCcart_enc:Value)
	END DO

RETURN TRUE

Any problem with this code?
TIA
Paulo Oliveira
0
Paulo
10/1/2009 11:37:43 AM
comp.clipper.visual-objects 12618 articles. 2 followers. Post Follow

2 Replies
373 Views

Similar Articles

[PageSpeed] 28

Paulo,

> 	auStruct:={{"...","C",8,0},{"T1","N",7,2},{"T2","N",7,2},{"T3","N",

Have not look in detail at rest of the code, but could it not be the 
Column name of "..."?  Not sure if it was just a typo from your side?

Johan Nel
Pretoria, South Africa.
0
Johan
10/1/2009 11:47:03 AM
Paulo,

So how about showing us the error and the line it occurs on or at least 
telling us exactly when/where it happens.

It will be a coding issue for sure But we need to know a little more. I 
can see a lot of potential problems with your code (especially using the 
notify approach) but I have to make assumptions about whether it is 
editable, when it is called to set up and so on. I would much prefer to 
see you use RowSelect and CellEdit rather than Notify().

Geoff


"Paulo Oliveira" <paulo@clipinfor.com> wrote in message 
news:e5c3c339-dce2-47b1-abe1-a0fb08d311d0@l13g2000yqb.googlegroups.com:

> Hi all,
>
> In 99% times that one of my clients report an access violation are
> editing this browser,
> In debug mode i never have an access violation in this.
>

0
Geoff
10/5/2009 6:41:45 AM
Reply: