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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid page Fault in User.Exe

Status
Not open for further replies.

TinLegs

Programmer
Jan 14, 2003
100
NZ
Greetings all, I have a legacy app compiled with C6.1 (Hotfix 9034) which will crash with the above error when run in Win95 or 98 (OK in XP). There is no consistancy and the program only crashes occassionly but obviously something I would like to fix or find a work around for. Problem occurs after opening an MDI window(s) then a Process. Before the Process is run I close any open windows prior using:
Loop I#=2 to 64
post(Event:CloseDown,,I#)
end
It appears to crash at the point after the file Process Window is first opened. It also appears that I am not the only one with this type of problem. Any suggestions greatly appreciated.
 
Hi!

Are you by chance changing any Window/control property before the Window is open? Have you tried whether having/not having the MDI attribute on the window makes any difference. Are you using IMDD?

All the above are guesses. Have you tried to debug the application to see which statement fails.

Regards
 
Thanks ShankarJ, I reckon I am not alone when I say you are a great asset to the Clarion community.
I am not using IMDD but do use MDI on all my Browse windows. It appears this code is the problem which I have in my Process as tests with and without so far seem to varify this but I can't see why? (Legacy app - C6.1)

PrepareProcedure ROUTINE
! Start of "Beginning of Procedure, Before Opening Files"
! [Priority 4000]
!Close everything except the Main Frame - so files can be processed
Loop I#=2 to 64
post(Event:CloseDown,,I#)
end
 
The above code will fail because :

1. You can have more that one window open on a thread. For example a Form and Browse. So your call will close the form provided it can be closed i.e. what happens if there is an user warning prompt in the Form about Saving/Cancelling changes. But it will not close the Browse.

2. If you are STARTing the current Process Procedure, than the current thread is also between 2 and 64 i.e. it will try to close itself.

3. I normally use this to check if any window is open and warn the user :

In the Frame procedure, before the procedure has been started, I check the ?Tile menu item (Window --> Tile) is disabled or not i.e. IF ?Tile{PROP:Disable} = True ... b'cos the Tile will be enabled ONLY if a thread with open windows are open.

Also, even if you want to use your code, you need to modify it to try three times assuming that any thread will be only three windows deep and use it in the frame before the process procedure is called and not in a routine of the process procedure.

Loop I#=2 to 64
loop 3 times
post(Event:CloseDown,,I#)
end
end

And, the above will work only if the procedure have windows.

HTH-Regards

P.S. : Thank you for your kind words
 
Thanks ShankarJ, using IF ?Tile{PROP:Disable}=TRUE... I can now conditionally enable/disable menu options on the main frame getting around my problem and doing without the code below completely. No more crashers in Win95/98

Loop I#=2 to 64
post(Event:CloseDown,,I#)
end

Only problem its recursive, I have a Routine in my main frame called from embed 'Other Window Event Handling' to check IF ?Tile{PROP:Disable}=TRUE... Do you think this recursive action could cause a problem? Same result using embed points Before/After Accept Loop. Just a little worried because its constantly running this Routine. Was unable to Debug to find actual cause of crash as all my computers are XP but do suspect the above code was the cause but only when other threads in use.

 
Hi!

Just save the last state i.e. LocalVar = ?Tile{PROP:Disable} and compare if the state has changed i.e. IF ?Tile{PROP:Disable} <> LocalVar before doing the routine.

Regards
 
Thanks ShankarJ, solution you gave re recursive was so simple I'm embarrassed. Its all been a great problem solver for me and I am sure other Clarion users will benefit also. Kind Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top