Ted, No but what I have done is now created a new base form (non subclassed) which works fine with the identical coding so there is something going astray with in the subclassing somewhere.
The extra subclassed events are only a "set talk off" and some other simple "set..." commands in the load, a borderstyle setting in the init and an embedded button on the form who's click event does the form release.
Even if I override the load and init with my own code the error still happens using the subclassed form and there is nothing else in there.
I think that this error is one of those that you can't recreate and rebuilding the form from scratch will make the problem go away.... I have spent far too long today on this so recreation it is.... after all if God could do the world in 6 days then one form will be a breeze! ;-)
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Ted Roche Sent: 06 January 2017 15:46 To: profox@leafe.com Subject: Re: New Year Brain Teaser...
Are you releasing the oData object before releasing the form?
On Fri, Jan 6, 2017 at 9:19 AM, Dave Crozier DaveC@flexipol.co.uk wrote:
Gentlemen, A bit of a problem here and I don't know what is causing it:
The result - a dreaded C5 error from VFP9
The scenario:
Non Modal Form with private datasession and one table open in the session... I want to use a data object to hold data in and then use this object to populate various controls on the form.
Initially none of the controls have a controlsource property assigned and they are allocated programmatically at runtime in the init.
The Form has a property added called oData added at design time.
In the init of the form the oData property is assigned i.e.
Select <table> Scatter name Thisform.oData memo
What I ultimately want to do is the following: Thisform.txtText1.ControlSource = "Thisform.oData.Field1" ... for each of the form controls etc.
The exit button on the form simply releases the form and should return back to the development mode but it doesn't - simply throwing a C5 error every time.
I have now got the bones of the problem down to the init of the form and the click of the exit button and no runtime controlsource setup for the form controls, and have a simple blank form with no controls on it so they are not the problem.
I have even tried assigning the oData property at runtime in the init() with:
Thisform.AddProperty("oData", null) immediately before the scatter
...and a lot of other "potential get arounds" all to no avail.
If I leave out the scatter then the form loads and exits no problem but as I say throws a C5 on form clicking the exit button as soon as it hits the return after Thisform.release
Ideas please as this is now driving me potty!
Dave
[excessive quoting removed by server]