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

C0000005 Error in VFP 7.0 on "Do Form Worker.scx"

Status
Not open for further replies.

tmcclure

Programmer
Nov 12, 2002
2
0
0
US
I have a very large application that I have been working on and perfecting for about 6 ½ years. It is written in FoxPro for Windows version 2.6. I am working on converting the App to VFP version 7.0. I can convert the old 2.6 screens to forms by opening a copy of the old project in version 7.0 and opening the old screens. Then it asks me if I want to convert the screen and I click on the functional conversion button and I am able to get a fairly workable application going this way. Unfortunately about 1 out of every ten times a line of code “DO FORM WORKER.SCX” is run I get a C0000005 error for this line of code. How can I fix this? The form converter puts a FormSet and a PageFrame into the Form that I don’t think I need. Do I need to redo these forms and eliminate the FormSet and the PageFrame? I have read on another forum about the necessity for garbage cleanup of pointers to objects but I have examined the memory just before the crash happens and I don’t have any objects defined at that time. I am sure other people have seen this error.
 
tmcclure,
I have migrated a number of my 2.6 apps to VFP, and I've found the best way to do that is to actually load the two prodcuts, and run them side-by-side. Rebuild your screens an objects on your new forms by hand, rather than using the VFP conversion utility. The primary reason for that is, you will want to sub-class all of your controls, even if you don't change any of the defaults. This may not make sense to you now, but believe me, as you become more VFP aware, you will understand it. And I mean everything, including text labels.
Then, on the old controls of you 2.6 app, you can migrate the code to the places that YOU want them. Realize, 2.6 had limited events, where most controls have many events now. You may find that you no longer want the code in WHEN and VALID caluses, when there are many other events that will allow much more control. If that is beyond you at the moment, that's okay too, but how the VFP converters deal with it is just plain strange.
Lastly, you will want to take any variables that you used to call as "REGIONAL" values in your old forms, and make them form properties. You can then reference them as ThisForm.lcMyProperty (or whatever name you give them). This keeps things scoped only to that form, and only for the values you need to be shared across the form. It's a different way of thinking about things, but it is very clean, and very handy once you get the hang of it.
It's a bit of a curve, but make the fight now.

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
There could be multiple reasons for GPF, most often one is a bad control source. Check and see if the control source for each object is ok and available.

Satyen
 
Thanks for your help. I went ahead and created a new form and moved the converted controls onto the new form. I got rid of the FormSet and the PageFrame this way. I got the form to work sometimes but I am still getting the same C0000005 error. I guess I will try to open every control and see if they are OK.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top