Home > Archive > Programming with dBASE > March 2006 > Unusual problem -









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unusual problem -
bigMike

2006-03-24, 8:24 pm

Hi to all -

I am having an unusual (for me) problem. I am testing my Calendar app. and
depending on how I run it, I get different results when I close forms down
and get back to the topmost parent form.

If I run the main .wfm file I don't have this problem. I can open a child
form and from the child form I can open a child form. When I close the
grandchild and child forms I end up with focus on my parent form. All is
normal. If I run it from my standard .prg file this does not happen. I close
the grandchild and child forms and now I'm not focused on anything but the
parent form is displayed. It does not have focus and trying to click
anywhere on it gives me a "ding" - meaning, I think, that something else has
focus but I can't figure out what it is - ie: I don't know where I am at
this point. Alt-tab gives me no clue as the form is not even listed.

Now, at the bottom of my Windows desktop is the area that shows you what
programs are currently opened. The parent form is listed there but I can't
do anything here either - it doesn't give me any of the normal choices of
closing, maximizing, etc. If I R/click on this item I can get the parent
form to appear to have focus(top of form frame turns darker blue) but I
still can't use it.

Below is my .prg file - and as commented I have tried 3 different ways of
using this, all with the same results.

I have to go into the taskmanager to delete the dB2K.exe entry to close down
dBase.

I am at a total loss as to what else to check. Anybody got any ideas?? This
is probably going to be something very simple but right now I just don't see
it.

Oh, yeah - I'm using Win2K and dB2K ver. 4 on my IBM laptop and have over
300mb of clear ram. All my forms are non-mdi.

bigMike

********************
********************
********************
****************
* Startup.prg
* Copyright 2005/2006 Michael Aadnesen All Rights Reserved

close all
clear all
Set Bell Off
Set Talk Off
Set Safety Off
Set Deleted On
Set Epoch to 1910
Set Century On
Set CUAENTER Off
Set Near off
Set Exact off
shell(false,false) <<=== I played around with changing
this with no different results

_app.build = 'ver. 1.0'

* set error handling routine -------------------------------------
SET PROCEDURE TO ERRHNDLR.PRG ADDITIVE
if NOT set("DEVELOPMENT") = "ON"
ON ERROR ErrHndlr( Error(), Message(), Program(), Lineno())
endif

SET PROCEDURE TO MyUDFs.PRG ADDITIVE

* Make sure only one instance open
SET PROCEDURE TO APPFLAG.CC ADDITIVE
_app.Flag = new AppFlag()
if NOT _app.Flag.open( "DSTP" ) AND "RUNTIME" $ upper(version(0))
if "RUNTIME" $ upper(version(0))
DO ALREADY.WFM
quit
endif
RETURN
endif

SET PROCEDURE TO MSG.WFM ADDITIVE
_app.Msg = NEW MSGFORM()

_app.VoiceOn = true
_app.Access = "Limited"
_app.BackDoor = "BACKDOOR"

DO MergeTables.prg

Set Procedure to Calendar.wfm additive
oPrgm = NEW CalendarFORM()
oPrgm.Open()

* set procedure to Calendar.wfm additive
* form.AddRec = NEW CalendarFORM()
* form.AddRec.Parent = FORM
* form.AddRec.ReadModal()
* form.AddRec.Release()
* form.AddRec = NULL
* close procedure Calendar.wfm

Return







bigMike

2006-03-25, 1:24 pm

For further clarification:

If I only open the parent and child forms I don't have a problem. When I
open the grandchild form - whether or not I do anything (I can just
immediately close it) - I have the problem.
Focus goes to the framewin and I have to get out of dB2k in order to get rid
of the Parent window.

PARENT --> CHILD --> PARENT = OK
PARENT --> CHILD --> GRANDCHILD --> CHILD --> FRAMEWIN = Focus is on
framewin and the parent window is on the windows desktop underneath the
framewin screen.

I was thinking maybe the SHELL setting was screwed up but I guess not. I
can't see any code in the grandchild or child form that would cause this.
But, I don't really know what to look for. Everything seems normal to me.

So these are the symptoms - what's the cure?? If I could figure out what
happens after control comes back to the parent form, _maybe_ I could figure
this out.

Here is what I have:

Parent form code
* user can push any of 31 pushbuttons representing a day of target month
* this opens up next window
function PB1_onClick1 && row1 Sun
* Date is printed on the button
_app.DayTitle = "Sunday "+trim(form.CONTAINER1_1.PB1.text)+"
"+trim(form.text1.text)
form.DayDate = trim(form.CONTAINER1_1.PB1.text)
CLASS::ShowDay()
return

function Showday
set procedure to ShowDay.wfm additive
oAddRec = NEW ShowDayFORM()
oAddRec.Parent = FORM
oAddRec.PickedDate = dPickedDate
oAddRec.ReadModal()
oAddRec.Release()
oAddRec = NULL
close procedure ShowDay.wfm
return

In the debugger I can see that when the grandchild and child forms close,
focus goes to the "return" of the "function Showday"....then goes to the
"return" of the "function PB1_onClick1". This is when the Ship hits the
Sand ;-) I can't follow anything after this.

I am hoping one of you know what's happening here. I plead my ignorance. I
really don't know what to look for.

TIA

bigMike



Marc VdB

2006-03-27, 3:23 am

Hi bigMike,

i remember having had a similar thing. It was an error msgbox, that was
hidden behind the _app.window, and i was unable to reach it, because it
wanted input, but i could not get to it with the mouse. Hitting return
brought me back to the application, and when i found the error, the problem
went away.
Don't remember the circumstances, but your problem sounds familiar...

HTH, Marc
--
www.vdblogic.de/dbl
------


Bruce Beacham

2006-03-27, 7:26 am

bigMike wrote:

> Now, at the bottom of my Windows desktop is the area that shows you what
> programs are currently opened. The parent form is listed there but I can't
> do anything here either - it doesn't give me any of the normal choices of
> closing, maximizing, etc. If I R/click on this item I can get the parent
> form to appear to have focus(top of form frame turns darker blue) but I
> still can't use it.


That's a pity, because I think the way to bring a hidden msgbox to the
front is to minimise the app and then pane it again, using the taskbar icon.

No other suggestions, I'm afraid.

Bruce Beacham
bigMike

2006-03-27, 11:24 am

Hi Marc -

I wish that was what this was. Thing is with the error box, it would show
up as a selection when you ALT-TAB to see what's active - it doesn't even
show the Parent window that I can see right in front of me. So, if the form
doesn't register in windows and I can't click on it, move it or do anything
to it.... isn't this a clear symptom of something?? What a dumb question..
but you know what I mean. It sounds like the parent form got closed but not
closed. The only code I have to close the form resides in a pushbutton and
a form.close() statement - which isn't being activated.

That was a good guess on your part though .... thanks.

bigMike



bigMike

2006-03-27, 8:24 pm

Hi All -

I FOUND IT!!! ;-)

I repeated the following in the grandchild form that was already initiated
in the Startup.prg which calls the Parent form:

_app.Msg = NEW MSGFORM()

Accidentally done I assure you but look at all the pain it caused. Somehow
this caused focus to go to the _app.frameWin - I think. Hey, Ken (or anyone
else) - is this what happened?? I still don't understand why this would
happen.

But I'm happy again:-))

Thanks to Al Abbott, Marc VDB, Bruce BeachhamGerald Lightsey and Marc
Hamelin for all comments and suggestions.

bigMike




Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com