Start_Window Question (OpenInsight Specific)
At 04 DEC 1998 05:46:05PM Greg James, ISIS, Inc. wrote:
The entry point of my application is a login/password form. The click event for the 'OK' button on this form makes sure that the user is eligible to use the application and then starts the program's main form.
To do this I am using: Start_Window ('MAIN_FORM','',UserName). I left the 'parentID' parament null becasue I didn't want the login form to be the main form's 'PARENT'.
I would like to close the login window after the main window has been launched. I have tried doing this using Send_Event('LOGIN_FORM','CLOSE') from the CREATE event of the main form, but when I try this I get the following error:
'The labeled common variable has been freed and is no longer valid.'
This closes the login window, but not without first popping out the error message.
Any suggestions on what I am doing wrong? Thanks.
At 04 DEC 1998 06:22PM Don Bakke wrote:
Greg,
This normally occurs when you have closed a window but are still processing event code for that window. Since the window has closed, the event no longer has a context for its common variables.
We do a very similar thing in one of our applications. We simply placed the Send_Event statement right after the Start_Window statement of our login window. Just make sure this is the last statement that gets processed.
dbakke@srpcs.com
At 04 DEC 1998 06:53PM Dave Pociu wrote:
The way I log people in is this:
- My main form starts out invisible
- in the create script I launch 2 messages: 1 for name, one for password
- if user is OK, forward_event + make window visible
- if user not OK then close window without forward_event
At 05 DEC 1998 06:08AM Carl Pates Sprezzatura Ltd wrote:
Greg,
Have you tried Post_Event('LOGIN_FORM','CLOSE') ?
This usually gets around the problem of a form still processing code when closed….
Carl Pates
Sprezzatura Ltd