Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP Program crashes after more than 10th times of viewing report from browser

Status
Not open for further replies.

pinkiegreene

Programmer
Jun 25, 2014
2
MY
Hello and good day.
My vfp program crashes when user viewed the report through browser for more than 10 times. Program is developed on VFP8 on Win 7 platform. The program resides in Windows server 2008 with 4GB RAM. User, however, uses WinXP to login into the vfp program.

User will proceed to generate a report which displayed using BROWSER (OLE object). Program crashes with these error messages

Fatal error: Exception code=C0000005 @ 25/06/2014 09:24:13 AM. Error log file: Y:\CENTER\VFP8Rerr.log
Called from - frmvresult.browser1.init line 15 {y:\center\_webview.vct y:\center\_webview.vct}
Called from - frminquiry.cmdresult.click line 2 {y:\center\inquiryx.sct y:\center\inquiryx.sct}
Called from - patient.commandgroup1.command1.click line 2 {y:\center\patient.sct y:\center\patient.sct}
Called from - _3xm0jnqps line 459 {Y:\CENTER\cmenu.mpr cmenu.mpx}
Called from - ON... line 0 { }
Called from - _43m0j6jfi.activate line 70 {y:\center\main.sct y:\center\main.sct}
Called from - 3foo02m9 line 0 { y:\center\vclinic.exe}

I have debug many times in the program but unable to find an error. It just happens after more than 10 times of viewing the report. Then program closes and user has to re-login and everything will be fine for the next 10 timess.

Any advice is most appreciated!

Rgds
Pinkie
 
Well, what is the frmvresult.browser1.init code?
The line 15 of it causes the C5 error.

Typical causes of c5 errors can be DBF or FRX file curruption, dangling object references (eg using an object which has been destroyed already).

It may merely be random it happens at about the 10th usage. Could have to do with memory leaks, anything. I assume this is using a browser control, there might be something wrong about that in general, it's not released correctly in previous usages of the frmvresult.

Bye, Olaf.
 
Hello Olaf,

The INIT procedure from browser is actually an inherited code from _webview.scx (appended as below). After displaying result into IE browser, I do have an EXIT button which has the following :-

From EXIT button:-
DELETE FILE &mhtmfile
CLEAR EVENTS
Thisform.Release
RETURN


INIT procedure inherited from _webview.scx/sct
LPARAMETERS tcVFPScript

DIMENSION this.aHistory[1,2]
this.aHistory=""
this.oHost=thisform
this.oUser=CREATEOBJECT("Custom")
this.oUser.Name="oCustom"
this.nDataSessionID=thisform.DataSessionID
this.cProgramPath=IIF(TYPE("this.oHost.cProgramPath")=="C",this.oHost.cProgramPath, ;
this.ClassLibrary)
IF NOT "\"$this.cBlankHTMLFile AND NOT ":"$this.cBlankHTMLFile
this.cBlankHTMLFile=LOWER(this.cProgramPath+this.cBlankHTMLFile)
ENDIF
DO CASE
CASE ISNULL(tcVFPScript)
this.cVFPScript=""
CASE EMPTY(tcVFPScript) OR TYPE("tcVFPScript")#"C"
this.cVFPScript=LOWER(FULLPATH(this.cVFPScriptTable,this.cProgramPath))
OTHERWISE
this.cVFPScript=LOWER(ALLTRIM(tcVFPScript))
ENDCASE
IF EMPTY(this.cVFPScript)
this.lVFPScript=.F.
ENDIF
this.OpenVFPScript
SELECT 0
IF this.lBlankHTMLStartup AND NOT EMPTY(this.cBlankHTMLFile) AND FILE(this.cBlankHTMLFile)
this.Navigate(this.cBlankHTMLFile)
ENDIF
SELECT 0

 
Line 15 is CASE ISNULL(tcVFPScript), if I counted correctly.

So what do you pass in as tcVFPScript parameter? Log that before you make whatever you do in frminquiry.cmdresult.click line 2. It seems like that accidentally is some object instead of a script string in the case it causes a C5 it may be such an object that shouldn't be accessed, not even to check whether it's NULL.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top