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

Fatal Error 2

Status
Not open for further replies.
Sep 17, 2001
672
US
I am getting a fatal error which causes my program to crash and burn. The only major difference in my program now compared to others is the following:

Now I use a main program to init data then I have a subclasses template form which is run. When user selects new template I release the current form and call a new template. I am using more subclassed visual objects and a prg class file with all of my data commands. Does anything here so far raise any flags?

Regards,

Rob
 
This is the code I am using to close the current form and call another form. In this case I am releasing the only open form and further down doing another form, is there something wrong with this?

** template form combo box valid:
ThisForm.Release()
SELECT Ctemplate_securities
SET FILTER TO template_id_fk > 1
gnWidth = ThisForm.Width
gnHeight = ThisForm.Height
gnLeft = ThisForm.Left
gnTop = ThisForm.Top
DO FORM (Ctemplate_securities_nav.Template_Path)


Regards,

Rob
 

Rob,

I don't know if this is the cause of your problem, but doing THISFORM.Release in a Valid rings an alarm bell.

The purpose of a Valid is to control where focus goes after the current control loses focus. If the entire form is no longer available to receive focus ... well, I don't know if that is specifically disallowed, but it looks like it should be.

I suggest you comment out the THISFORM.Release, and see whether that gets past the error.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
You may also try putting that code in the InteractiveChange event instead of the Valid, but put ThisForm.Release() at the very end of the code or the rest of the code may not even execute.
I could be quite possible to get some sort of stack fault doing it your way.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks for the help. Moving the code from the valid to interactive made the difference. Somehow as suspected the releasing and calling of new forms from valid threw the stack or whatever off balance. Before the change clicking on one template 2-4 times would 99.% of the time throw the fatal error. Now after recompiling it with the code in the combo's init, I have clicked many times with no error. Having an unstable app would have been the end of my fox days so I greatly appreciate it and this forum has been my greatest ally in the war to succeed.

Regards,

Rob
 
Well I lied. Apparently by putting the code in the interactivechange event the code does not execute unless you actually change the value. Eventually however I am still getting the fatal error so I am still trying to figure this out. Has anyone else had issues calling forms then releasing the current form before the new form appears?

Regards,

Rob
 
Rob,

Are you getting an error message here? What sort of error are you seeing?

There shouldn't be any problem in closing the form from the InteractiveChange (unlike from the Valid), but it might be worth commenting out the Release anyway, just to see what the effect is.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Here is some detail I hope might help:

I have a main.prg for my starting point where I init some variables etc.

After this I call a login form. The login will connect to sql server via a data class I built which has all sql passthrough's inside it. It remeans visible to each formed that is called.

Then the login form calls the first template form which is built on a visual class of form type. In the queryunload is clearevents

Each form called thereafter is a sub-class of the main template form which is called and the previous template is released.


The biggest change in my program style here is using many visual classes for textbox's, combobox's, forms, etc.
Also the fact that I am calling a form and releasing in the same code block. This gives the user an illusion of never leaving the form but merely switching what is seen on the 'template'.

All this said is there any portion of this which raises flags?


Regards,

Rob
 

Rob,

I understand now what you are trying to achieve. But I will persist in my original point. Try commenting-out the Release statement to see if the problem goes away.

I'm not suggesting this as the solution. It's just a way of homing in on the problem.

Also, what exactly is the error you are seeing? Is there a message?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Sorry for not answering your direct questions:
Commenting the release would not do me any good since I would get a mess of forms pilling up and the whole point is to have the template close and open a new one leaving only 1 open and visiable. But for argument sake lets say the release was the problem, what would I try next?

The exact message is a variation of C000005... which says a fatal error has occured and prompts to send the info to microsoft. I can get a snapshot of the stack as of the error but can't understand any of it.

Regards,

Rob
 
Earlier Dave suggested you move the thisform.release() to the end of the code block. Did you do that? All the code after the thisform.release shouldn't even run.





Mike Reigler
Melange Computer Services, Inc
 
Yes I have the release at the end of the block now. Another note of detail here is the combobox with this code block is part of a visual class container which is then dropped on a visual class form template which I then use to create my actual variations of the template form.

Regards,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top