Hi,

I got this error on the last line ?!
anybody an idea.

procedure selectme
Lparameters loselectme
If TYPE("loselectme") <> "O" .or. isnull(loselectme)
Return .F.
Endif
lSelectLongName = loselectme.Parent.Name + loselectme.Name
...

I can say a lot about this on how it works
and at the same moment I don't have any clue !
This seems to bug a Vfp bug ?!
Because the code is quite clear I think.

So anyway I will try to explain the whole picture.
This procedure is from a "multiselectme"class I created.
I place this class on a form and call it when I want
to visually highlight an object.
(I visually highlight one or more objects by adding on each corner
a highlighter =small rectangular shape in a bright color)

the procedure is called something like this :
procedure myobject.rightclick
thisform.multiselect.selectme(this)
*dosomethingelse
thisform.multiselect.deselectme(this)

I only get this error when the user
Rclicks on the object when the form is not active !
So when the user first clicks on the form to activate it and then
Rclick on the object I don't get an error.
But of course I can't teach my user to do it this way.

So I tried to activate the form in the Rclick prior to
thisform.mulitselect.selectme
but whether I use This or Thisform I get the same error.

So has anybody an idea ?

thanks in advance
regards
christophe

Re: PARENT is not an object (Vfp bug?) by Stefan

Stefan
Mon Nov 29 04:47:20 CST 2004


Hi Christophe,

oForm=CREATEOBJECT('Form')
? oForm.Parent.Name
would give the same error, so changing this line
> If TYPE("loselectme") <> "O" .or. isnull(loselectme)
to become
If TYPE("loselectme.Parent.Name") <> "C"
would probably solve the symptom.
As for the *cause, FWIW personally I'm not sure if I understood
the scenario. You do not have a short, simplified runnable-repro.prg
by chance?


-Stefan

"christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
news:uoq8k3f1EHA.1456@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I got this error on the last line ?!
> anybody an idea.
>
> procedure selectme
> Lparameters loselectme
> If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> Return .F.
> Endif
> lSelectLongName = loselectme.Parent.Name + loselectme.Name
> ...
>
> I can say a lot about this on how it works
> and at the same moment I don't have any clue !
> This seems to bug a Vfp bug ?!
> Because the code is quite clear I think.
>
> So anyway I will try to explain the whole picture.
> This procedure is from a "multiselectme"class I created.
> I place this class on a form and call it when I want
> to visually highlight an object.
> (I visually highlight one or more objects by adding on each corner
> a highlighter =small rectangular shape in a bright color)
>
> the procedure is called something like this :
> procedure myobject.rightclick
> thisform.multiselect.selectme(this)
> *dosomethingelse
> thisform.multiselect.deselectme(this)
>
> I only get this error when the user
> Rclicks on the object when the form is not active !
> So when the user first clicks on the form to activate it and then
> Rclick on the object I don't get an error.
> But of course I can't teach my user to do it this way.
>
> So I tried to activate the form in the Rclick prior to
> thisform.mulitselect.selectme
> but whether I use This or Thisform I get the same error.
>
> So has anybody an idea ?
>
> thanks in advance
> regards
> christophe
>
>


Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Mon Nov 29 05:57:30 CST 2004

euh,
a sample of thousend+ line
is that an option ;-) ?

as for your solution.
I'm afraid that's not the case
because in the Rclick of the
object (f.e. a container)
I also get the same error when I use
rthis_ = this.parent
I just can't use This, even Thisform is not "available"
I've first tried Thisform.setfocus or .show() or .activate
but nothing helps.

procedure mycontainerobject.rightclick
rthis_ = this.parent &&same Error ??
DO WHILE rthis_.baseclass <> "Form"
rthis_ = rthis_.parent
ENDDO
rthis_.show()
thisform.multiselect.selectme(this)
*dosomethingelse
thisform.multiselect.deselectme(this)

regards
christophe

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
news:%23GBj0Bg1EHA.2824@TK2MSFTNGP09.phx.gbl...
>
> Hi Christophe,
>
> oForm=CREATEOBJECT('Form')
> ? oForm.Parent.Name
> would give the same error, so changing this line
> > If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> to become
> If TYPE("loselectme.Parent.Name") <> "C"
> would probably solve the symptom.
> As for the *cause, FWIW personally I'm not sure if I understood
> the scenario. You do not have a short, simplified runnable-repro.prg
> by chance?
>
>
> -Stefan
>
> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> news:uoq8k3f1EHA.1456@TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > I got this error on the last line ?!
> > anybody an idea.
> >
> > procedure selectme
> > Lparameters loselectme
> > If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> > Return .F.
> > Endif
> > lSelectLongName = loselectme.Parent.Name + loselectme.Name
> > ...
> >
> > I can say a lot about this on how it works
> > and at the same moment I don't have any clue !
> > This seems to bug a Vfp bug ?!
> > Because the code is quite clear I think.
> >
> > So anyway I will try to explain the whole picture.
> > This procedure is from a "multiselectme"class I created.
> > I place this class on a form and call it when I want
> > to visually highlight an object.
> > (I visually highlight one or more objects by adding on each corner
> > a highlighter =small rectangular shape in a bright color)
> >
> > the procedure is called something like this :
> > procedure myobject.rightclick
> > thisform.multiselect.selectme(this)
> > *dosomethingelse
> > thisform.multiselect.deselectme(this)
> >
> > I only get this error when the user
> > Rclicks on the object when the form is not active !
> > So when the user first clicks on the form to activate it and then
> > Rclick on the object I don't get an error.
> > But of course I can't teach my user to do it this way.
> >
> > So I tried to activate the form in the Rclick prior to
> > thisform.mulitselect.selectme
> > but whether I use This or Thisform I get the same error.
> >
> > So has anybody an idea ?
> >
> > thanks in advance
> > regards
> > christophe
> >
> >
>



Re: PARENT is not an object (Vfp bug?) by Stefan

Stefan
Mon Nov 29 06:27:31 CST 2004


"christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
> euh,
> a sample of thousend+ line
> is that an option ;-) ?

Well... Let's say fifty? :-)
The one below does not show the missing-parent behaviour.
Maybe you can modify it?

And I believe I have not seen anything similar to your description
yet - except when there are "external" things involved, like menu
code or SomeExternalProcedures() outside the current object.


-Stefan

* rightclick_parent_issues.prg
PUBLIC oForm1, oForm2
oForm1 = CREATEOBJECT('TestForm')
oForm2 = CREATEOBJECT('TestForm')

oForm1.Show()
oForm2.AutoCenter = .T.
oForm2.Show()
WAIT "Right-Click container of inactive form" WINDOW NOWAIT
RETURN


DEFINE CLASS TestForm as Form
ADD OBJECT RTContainer as Container WITH ;
Top = 80, Left = 140
PROCEDURE RTContainer.RightClick
MESSAGEBOX(This.Parent.Name)
ENDPROC
ENDDEFINE


Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Mon Nov 29 09:42:55 CST 2004

Hi again Stefan,

the code looks more like this below
and of course it doesn't reproduce the error
(if it was that easy to reproduce my error I think nobody
would ever work with Vfp again .... ;-)
but there is also a menu involved (not in the sample below,
because I don't exactly know how to write it, I made it
with the menudesigner.)
this menu is activated upon mycontainer.rightclick which opens another form
and there my problems start occuring when rightclick on the inactiveform.
And also the biggest difference between the sample and
the real app is I've also used the form designer to create the form
and in the init I add the containers.
But it should be the same I think ...

PUBLIC oForm1, oForm2
_screen.Visible = .f.
oForm1 = CREATEOBJECT('TestForm',SYS(2015))
oForm2 = CREATEOBJECT('TestForm',SYS(2015))
oForm1.Show(1)
oForm2.AutoCenter = .T.
oForm2.Show(2)
RETURN


DEFINE CLASS TestForm as Form
desktop = .t.

PROCEDURE init
LPARAMETERS lname
this.name = lname
this.Caption = this.name
this.AddObject("mycontainer","rtcontainer")
this.mycontainer.visible = .T.
ENDDEFINE

DEFINE CLASS rtcontainer as Container
top = 80
left = 140
newform = ""

PROCEDURE click
MESSAGEBOX(This.Parent.Name)

PROCEDURE mousedown
Lparameters nButton, nShift, nXCoord, nYCoord
IF .not. pemstatus(this.parent,"shape1",5)
WITH this
.AddObject("shape1","shape")
WITH .shape1
.left = .left
.height = 5
.width = 5
.bordercolor = 255
.visible = .t.
endwith
ENDWITH
ELSE
thisform.shape1.bordercolor = 10485760
ENDIF

PROCEDURE rightclick
this.newform = CREATEOBJECT('TestForm',SYS(2015))
newform = this.newform
IF TYPE("newform") = "O" .and. .not. ISNULL(newform)
this.newform.show(2)
endif
enddefine

regards
christophe

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
news:e1zTX7g1EHA.2804@TK2MSFTNGP15.phx.gbl...
>
> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
> > euh,
> > a sample of thousend+ line
> > is that an option ;-) ?
>
> Well... Let's say fifty? :-)
> The one below does not show the missing-parent behaviour.
> Maybe you can modify it?
>
> And I believe I have not seen anything similar to your description
> yet - except when there are "external" things involved, like menu
> code or SomeExternalProcedures() outside the current object.
>
>
> -Stefan
>
> * rightclick_parent_issues.prg
> PUBLIC oForm1, oForm2
> oForm1 = CREATEOBJECT('TestForm')
> oForm2 = CREATEOBJECT('TestForm')
>
> oForm1.Show()
> oForm2.AutoCenter = .T.
> oForm2.Show()
> WAIT "Right-Click container of inactive form" WINDOW NOWAIT
> RETURN
>
>
> DEFINE CLASS TestForm as Form
> ADD OBJECT RTContainer as Container WITH ;
> Top = 80, Left = 140
> PROCEDURE RTContainer.RightClick
> MESSAGEBOX(This.Parent.Name)
> ENDPROC
> ENDDEFINE
>



Re: PARENT is not an object (Vfp bug?) by Stefan

Stefan
Tue Nov 30 02:14:05 CST 2004


"christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
news:eytUkoi1EHA.3404@TK2MSFTNGP10.phx.gbl...
> Hi again Stefan,
>
> the code looks more like this below
> and of course it doesn't reproduce the error
> (if it was that easy to reproduce my error I think nobody
> would ever work with Vfp again .... ;-)

Okay ... I'll have another think about that sentence later <g>

Seriously, there are a lot repros for long-standing and surprising
bugs which are even shorter. Most of them certainly required
hours or even days of work though.
IME when such "mysterious" things happened and I finally tracked
them down hopefully, usually it turns out to be a bug in my own
custom code. Say some 110%
In stiff-necked cases nothing might help except making a copy of
the entire thing and throw away one piece after the other until ...


> but there is also a menu involved (not in the sample below,
> because I don't exactly know how to write it, I made it
> with the menudesigner.)
> this menu is activated upon mycontainer.rightclick which opens another form
> and there my problems start occuring when rightclick on the inactiveform.

Sounds suspicious!
You can integrate menus by just copying the content of
yourMenu.MPR, maybe beautify it a little and put it in a method()
for example.


> And also the biggest difference between the sample and
> the real app is I've also used the form designer to create the form
> and in the init I add the containers.
> But it should be the same I think ...

Ja, does not sound extremely suspicious to me too

DEFINE CLASS rtcontainer as Container
&& all the same, bottom modifed:
*!* PROCEDURE rightclick
PROCEDURE RightClick
DEFINE POPUP SCMenu SHORTCUT ;
RELATIVE FROM MROW(),MCOL()

DEFINE BAR 1 OF SCMenu PROMPT "New Form"
&&ON BAR 1 OF SCMenu This.CallForm() && would error
ON BAR 1 OF SCMenu ;
_screen.ActiveForm.myContainer.CallForm()

DEFINE BAR 2 OF SCMenu PROMPT "\-"
DEFINE BAR 3 OF SCMenu PROMPT "Cancel"

ACTIVATE POPUP SCMenu
ENDPROC
PROCEDURE CallForm
this.newform = CREATEOBJECT('TestForm',SYS(2015))
IF VARTYPE(this.newform) = "O"
this.newform.show(2)
ENDIF
ENDPROC
enddefine


hth
-Stefan


Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Tue Nov 30 02:17:14 CST 2004

Stefan,

If TYPE("loselectme") <> "O" .or. isnull(loselectme)
Return .F.
Endif
IF loselectme.baseclass = "Form"
RETURN .f.
endif

Even checking if it's a form doesn't help
And I still get the same error !
Is this some kind of a bad programming behaviour of me
or is this some kind of reaching the limits of vfp ?

regards
christophe

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
news:e1zTX7g1EHA.2804@TK2MSFTNGP15.phx.gbl...
>
> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
> > euh,
> > a sample of thousend+ line
> > is that an option ;-) ?
>
> Well... Let's say fifty? :-)
> The one below does not show the missing-parent behaviour.
> Maybe you can modify it?
>
> And I believe I have not seen anything similar to your description
> yet - except when there are "external" things involved, like menu
> code or SomeExternalProcedures() outside the current object.
>
>
> -Stefan
>
> * rightclick_parent_issues.prg
> PUBLIC oForm1, oForm2
> oForm1 = CREATEOBJECT('TestForm')
> oForm2 = CREATEOBJECT('TestForm')
>
> oForm1.Show()
> oForm2.AutoCenter = .T.
> oForm2.Show()
> WAIT "Right-Click container of inactive form" WINDOW NOWAIT
> RETURN
>
>
> DEFINE CLASS TestForm as Form
> ADD OBJECT RTContainer as Container WITH ;
> Top = 80, Left = 140
> PROCEDURE RTContainer.RightClick
> MESSAGEBOX(This.Parent.Name)
> ENDPROC
> ENDDEFINE
>



Re: PARENT is not an object (Vfp bug?) by Stefan

Stefan
Tue Nov 30 02:51:23 CST 2004

Hi Christophe,

My guess is the problem might be related to the inside-objets vs.
"external" (menu) code PRG/MPR aspect...

When you get the error in the example below, do you see anything
unexpected in the debugger?
- Watch window
loSelectMe
VarType(loSelectMe)
loSelectme.BaseClass
loSelectme.Parent
- Trace window
Object:
Procedure
- Call Stack window content


-Stefan

"christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
news:uP$7HUr1EHA.1264@TK2MSFTNGP12.phx.gbl...
> Stefan,
>
> If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> Return .F.
> Endif
> IF loselectme.baseclass = "Form"
> RETURN .f.
> endif
>
> Even checking if it's a form doesn't help
> And I still get the same error !
> Is this some kind of a bad programming behaviour of me
> or is this some kind of reaching the limits of vfp ?
>
> regards
> christophe
>
> "Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
> news:e1zTX7g1EHA.2804@TK2MSFTNGP15.phx.gbl...
>>
>> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
>> news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
>> > euh,
>> > a sample of thousend+ line
>> > is that an option ;-) ?
>>
>> Well... Let's say fifty? :-)
>> The one below does not show the missing-parent behaviour.
>> Maybe you can modify it?
>>
>> And I believe I have not seen anything similar to your description
>> yet - except when there are "external" things involved, like menu
>> code or SomeExternalProcedures() outside the current object.
>>
>>
>> -Stefan
>>
>> * rightclick_parent_issues.prg
>> PUBLIC oForm1, oForm2
>> oForm1 = CREATEOBJECT('TestForm')
>> oForm2 = CREATEOBJECT('TestForm')
>>
>> oForm1.Show()
>> oForm2.AutoCenter = .T.
>> oForm2.Show()
>> WAIT "Right-Click container of inactive form" WINDOW NOWAIT
>> RETURN
>>
>>
>> DEFINE CLASS TestForm as Form
>> ADD OBJECT RTContainer as Container WITH ;
>> Top = 80, Left = 140
>> PROCEDURE RTContainer.RightClick
>> MESSAGEBOX(This.Parent.Name)
>> ENDPROC
>> ENDDEFINE
>>
>
>


Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Tue Nov 30 02:59:10 CST 2004

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
news:%23y%23IiSr1EHA.1860@TK2MSFTNGP15.phx.gbl...
>
> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> news:eytUkoi1EHA.3404@TK2MSFTNGP10.phx.gbl...
> > Hi again Stefan,
> >
> > the code looks more like this below
> > and of course it doesn't reproduce the error
> > (if it was that easy to reproduce my error I think nobody
> > would ever work with Vfp again .... ;-)
>
> Okay ... I'll have another think about that sentence later <g>
>
> Seriously, there are a lot repros for long-standing and surprising
> bugs which are even shorter. Most of them certainly required
> hours or even days of work though.

This got me for about 2 days. I don't now if
this is long (of course compared to what and who...;-).
But surprisingly I found a (very ugly) workaround.
I mean ugly programming and ugly for the user.
The result doesn't at least trow an error but
the user will have to click twice.
normally the first throws an error
but this is now trapped
and the second click is bingo the app does
what I think it should do.
(I think the whole Vfp stack is finnaly finished so the program
behaves normal again.) and the menu popups up.

If TYPE("loselectme") <> "O" .or. isnull(loselectme)
Return .F.
Endif
IF loselectme.baseclass = "Form"
RETURN .f.
endif
IF .not. pemstatus(planmain,"Parent",5)
RETURN .f.
ENDIF
IF TYPE("loselectme.Parent") <> "O"
RETURN .f.
endif

> IME when such "mysterious" things happened and I finally tracked
> them down hopefully, usually it turns out to be a bug in my own
> custom code. Say some 110%

In the past I would certainly agree
only this one, I'm not sure...


> In stiff-necked cases nothing might help except making a copy of
> the entire thing and throw away one piece after the other until ...
>
>
> > but there is also a menu involved (not in the sample below,
> > because I don't exactly know how to write it, I made it
> > with the menudesigner.)
> > this menu is activated upon mycontainer.rightclick which opens another
form
> > and there my problems start occuring when rightclick on the
inactiveform.
>
> Sounds suspicious!
> You can integrate menus by just copying the content of
> yourMenu.MPR, maybe beautify it a little and put it in a method()
> for example.

Yes I know, my Vfp knowledge containes some (read: a lot) of
black wholes ...

>
>
> > And also the biggest difference between the sample and
> > the real app is I've also used the form designer to create the form
> > and in the init I add the containers.
> > But it should be the same I think ...
>
> Ja, does not sound extremely suspicious to me too
>
> DEFINE CLASS rtcontainer as Container
> && all the same, bottom modifed:
> *!* PROCEDURE rightclick
> PROCEDURE RightClick
> DEFINE POPUP SCMenu SHORTCUT ;
> RELATIVE FROM MROW(),MCOL()
>
> DEFINE BAR 1 OF SCMenu PROMPT "New Form"
> &&ON BAR 1 OF SCMenu This.CallForm() && would error
> ON BAR 1 OF SCMenu ;
> _screen.ActiveForm.myContainer.CallForm()
>
> DEFINE BAR 2 OF SCMenu PROMPT "\-"
> DEFINE BAR 3 OF SCMenu PROMPT "Cancel"
>
> ACTIVATE POPUP SCMenu
> ENDPROC
> PROCEDURE CallForm
> this.newform = CREATEOBJECT('TestForm',SYS(2015))
> IF VARTYPE(this.newform) = "O"
> this.newform.show(2)
> ENDIF
> ENDPROC
> enddefine

This reminds me of an other weird problem where I've spend
some time on it.
This hard coding never worked, I had to work with the menu designer
to just let it popup next to my mouse. It poped up but never next to my
mouse.
The solution was so easy with the menu designer and never worked
in code. Somebody told me it was something with hiding the mainform
combined with forms that are "As top level forms" and a combination
of modal and modaless forms.

>
>
> hth
> -Stefan
>

At least I can say Thanks A Lot For The Help.
Problem "solved"
but I'm afraid it will certainly popup again,
somewhere else....

regards
christophe



Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Tue Nov 30 03:09:59 CST 2004

euh,
I've never worked with the debugger,
I tried it know but the app doesn't start
and Vfp and the debugger closes !?

What I did is open the debugger
added the code you've adviced
and in the vfp command window I start my app.

christophe

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
news:O2Ph7nr1EHA.936@TK2MSFTNGP12.phx.gbl...
> Hi Christophe,
>
> My guess is the problem might be related to the inside-objets vs.
> "external" (menu) code PRG/MPR aspect...
>
> When you get the error in the example below, do you see anything
> unexpected in the debugger?
> - Watch window
> loSelectMe
> VarType(loSelectMe)
> loSelectme.BaseClass
> loSelectme.Parent
> - Trace window
> Object:
> Procedure
> - Call Stack window content
>
>
> -Stefan
>
> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> news:uP$7HUr1EHA.1264@TK2MSFTNGP12.phx.gbl...
> > Stefan,
> >
> > If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> > Return .F.
> > Endif
> > IF loselectme.baseclass = "Form"
> > RETURN .f.
> > endif
> >
> > Even checking if it's a form doesn't help
> > And I still get the same error !
> > Is this some kind of a bad programming behaviour of me
> > or is this some kind of reaching the limits of vfp ?
> >
> > regards
> > christophe
> >
> > "Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
> > news:e1zTX7g1EHA.2804@TK2MSFTNGP15.phx.gbl...
> >>
> >> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> >> news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
> >> > euh,
> >> > a sample of thousend+ line
> >> > is that an option ;-) ?
> >>
> >> Well... Let's say fifty? :-)
> >> The one below does not show the missing-parent behaviour.
> >> Maybe you can modify it?
> >>
> >> And I believe I have not seen anything similar to your description
> >> yet - except when there are "external" things involved, like menu
> >> code or SomeExternalProcedures() outside the current object.
> >>
> >>
> >> -Stefan
> >>
> >> * rightclick_parent_issues.prg
> >> PUBLIC oForm1, oForm2
> >> oForm1 = CREATEOBJECT('TestForm')
> >> oForm2 = CREATEOBJECT('TestForm')
> >>
> >> oForm1.Show()
> >> oForm2.AutoCenter = .T.
> >> oForm2.Show()
> >> WAIT "Right-Click container of inactive form" WINDOW NOWAIT
> >> RETURN
> >>
> >>
> >> DEFINE CLASS TestForm as Form
> >> ADD OBJECT RTContainer as Container WITH ;
> >> Top = 80, Left = 140
> >> PROCEDURE RTContainer.RightClick
> >> MESSAGEBOX(This.Parent.Name)
> >> ENDPROC
> >> ENDDEFINE
> >>
> >
> >
>



Re: PARENT is not an object (Vfp bug?) by Stefan

Stefan
Tue Nov 30 03:22:50 CST 2004


The debugger is a very helpful tool.
When you get an error, you can click "Suspend" and use the IDE
menu: Tools -> Debugger to get it and step thru your code <F8>.
Or add a line right before the suspicious sequence
Set Step On

When you have Set Asserts On, you can also
Assert .F. && forgotten line gives no error at runtime
or something like
Assert (myCondition) Message "Hi, Christophe"
Assert ( USED('importantAlias') )
Assert ( Type("importantObject.Name")="C" ) && etc.


Regards
-Stefan


"christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
news:ORp6kxr1EHA.2716@TK2MSFTNGP14.phx.gbl...
> euh,
> I've never worked with the debugger,
> I tried it know but the app doesn't start
> and Vfp and the debugger closes !?
>
> What I did is open the debugger
> added the code you've adviced
> and in the vfp command window I start my app.
>
> christophe
>
> "Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
> news:O2Ph7nr1EHA.936@TK2MSFTNGP12.phx.gbl...
>> Hi Christophe,
>>
>> My guess is the problem might be related to the inside-objets vs.
>> "external" (menu) code PRG/MPR aspect...
>>
>> When you get the error in the example below, do you see anything
>> unexpected in the debugger?
>> - Watch window
>> loSelectMe
>> VarType(loSelectMe)
>> loSelectme.BaseClass
>> loSelectme.Parent
>> - Trace window
>> Object:
>> Procedure
>> - Call Stack window content
>>
>>
>> -Stefan
>>
>> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
>> news:uP$7HUr1EHA.1264@TK2MSFTNGP12.phx.gbl...
>> > Stefan,
>> >
>> > If TYPE("loselectme") <> "O" .or. isnull(loselectme)
>> > Return .F.
>> > Endif
>> > IF loselectme.baseclass = "Form"
>> > RETURN .f.
>> > endif
>> >
>> > Even checking if it's a form doesn't help
>> > And I still get the same error !
>> > Is this some kind of a bad programming behaviour of me
>> > or is this some kind of reaching the limits of vfp ?
>> >
>> > regards
>> > christophe
>> >
>> > "Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
>> > news:e1zTX7g1EHA.2804@TK2MSFTNGP15.phx.gbl...
>> >>
>> >> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
>> >> news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
>> >> > euh,
>> >> > a sample of thousend+ line
>> >> > is that an option ;-) ?
>> >>
>> >> Well... Let's say fifty? :-)
>> >> The one below does not show the missing-parent behaviour.
>> >> Maybe you can modify it?
>> >>
>> >> And I believe I have not seen anything similar to your description
>> >> yet - except when there are "external" things involved, like menu
>> >> code or SomeExternalProcedures() outside the current object.
>> >>
>> >>
>> >> -Stefan
>> >>
>> >> * rightclick_parent_issues.prg
>> >> PUBLIC oForm1, oForm2
>> >> oForm1 = CREATEOBJECT('TestForm')
>> >> oForm2 = CREATEOBJECT('TestForm')
>> >>
>> >> oForm1.Show()
>> >> oForm2.AutoCenter = .T.
>> >> oForm2.Show()
>> >> WAIT "Right-Click container of inactive form" WINDOW NOWAIT
>> >> RETURN
>> >>
>> >>
>> >> DEFINE CLASS TestForm as Form
>> >> ADD OBJECT RTContainer as Container WITH ;
>> >> Top = 80, Left = 140
>> >> PROCEDURE RTContainer.RightClick
>> >> MESSAGEBOX(This.Parent.Name)
>> >> ENDPROC
>> >> ENDDEFINE
>> >>
>> >
>> >
>>
>
>


Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Tue Nov 30 03:50:20 CST 2004

Oh I see,

I used a combination of low level file functions
and messagebox.
Because like i mentioned for some reason I can't get
my app working with the debugger.

regards
christophe

"Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
news:e6Pyz4r1EHA.3816@TK2MSFTNGP09.phx.gbl...
>
> The debugger is a very helpful tool.
> When you get an error, you can click "Suspend" and use the IDE
> menu: Tools -> Debugger to get it and step thru your code <F8>.
> Or add a line right before the suspicious sequence
> Set Step On
>
> When you have Set Asserts On, you can also
> Assert .F. && forgotten line gives no error at runtime
> or something like
> Assert (myCondition) Message "Hi, Christophe"
> Assert ( USED('importantAlias') )
> Assert ( Type("importantObject.Name")="C" ) && etc.
>
>
> Regards
> -Stefan
>
>
> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> news:ORp6kxr1EHA.2716@TK2MSFTNGP14.phx.gbl...
> > euh,
> > I've never worked with the debugger,
> > I tried it know but the app doesn't start
> > and Vfp and the debugger closes !?
> >
> > What I did is open the debugger
> > added the code you've adviced
> > and in the vfp command window I start my app.
> >
> > christophe
> >
> > "Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
> > news:O2Ph7nr1EHA.936@TK2MSFTNGP12.phx.gbl...
> >> Hi Christophe,
> >>
> >> My guess is the problem might be related to the inside-objets vs.
> >> "external" (menu) code PRG/MPR aspect...
> >>
> >> When you get the error in the example below, do you see anything
> >> unexpected in the debugger?
> >> - Watch window
> >> loSelectMe
> >> VarType(loSelectMe)
> >> loSelectme.BaseClass
> >> loSelectme.Parent
> >> - Trace window
> >> Object:
> >> Procedure
> >> - Call Stack window content
> >>
> >>
> >> -Stefan
> >>
> >> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> >> news:uP$7HUr1EHA.1264@TK2MSFTNGP12.phx.gbl...
> >> > Stefan,
> >> >
> >> > If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> >> > Return .F.
> >> > Endif
> >> > IF loselectme.baseclass = "Form"
> >> > RETURN .f.
> >> > endif
> >> >
> >> > Even checking if it's a form doesn't help
> >> > And I still get the same error !
> >> > Is this some kind of a bad programming behaviour of me
> >> > or is this some kind of reaching the limits of vfp ?
> >> >
> >> > regards
> >> > christophe
> >> >
> >> > "Stefan Wuebbe" <stefan.wuebbe@gmx.de> schreef in bericht
> >> > news:e1zTX7g1EHA.2804@TK2MSFTNGP15.phx.gbl...
> >> >>
> >> >> "christophe" <irs.znospamforme@skynet.be> schrieb im Newsbeitrag
> >> >> news:e2gwjqg1EHA.3000@TK2MSFTNGP15.phx.gbl...
> >> >> > euh,
> >> >> > a sample of thousend+ line
> >> >> > is that an option ;-) ?
> >> >>
> >> >> Well... Let's say fifty? :-)
> >> >> The one below does not show the missing-parent behaviour.
> >> >> Maybe you can modify it?
> >> >>
> >> >> And I believe I have not seen anything similar to your description
> >> >> yet - except when there are "external" things involved, like menu
> >> >> code or SomeExternalProcedures() outside the current object.
> >> >>
> >> >>
> >> >> -Stefan
> >> >>
> >> >> * rightclick_parent_issues.prg
> >> >> PUBLIC oForm1, oForm2
> >> >> oForm1 = CREATEOBJECT('TestForm')
> >> >> oForm2 = CREATEOBJECT('TestForm')
> >> >>
> >> >> oForm1.Show()
> >> >> oForm2.AutoCenter = .T.
> >> >> oForm2.Show()
> >> >> WAIT "Right-Click container of inactive form" WINDOW NOWAIT
> >> >> RETURN
> >> >>
> >> >>
> >> >> DEFINE CLASS TestForm as Form
> >> >> ADD OBJECT RTContainer as Container WITH ;
> >> >> Top = 80, Left = 140
> >> >> PROCEDURE RTContainer.RightClick
> >> >> MESSAGEBOX(This.Parent.Name)
> >> >> ENDPROC
> >> >> ENDDEFINE
> >> >>
> >> >
> >> >
> >>
> >
> >
>



Re: PARENT is not an object (Vfp bug?) by frederic

frederic
Tue Nov 30 04:20:41 CST 2004

Bonjour christophe, Stefan

PMJI,


Set the debugger in its frame

VFP, menu 'Tools', Debug tab, Environment : Debug frame

don't forget to "set as default"

depending VFP version, debug in Foxpro frame was not that stable and gave Dr
Watson, AKA C..5

HTH

Fred

Pour mémoire, tu nous as écrit :

> Oh I see,
>
> I used a combination of low level file functions
> and messagebox.
> Because like i mentioned for some reason I can't get
> my app working with the debugger.
>
> regards
> christophe
>


--
- Fred
FE AVP&Cie
MS VFP MVP
email : http://cerbermail.com/?jWyjWqURpf
Membre actif d'AtoutFox,
Communauté Francophone des Professionnels FoxPro
http://www.atoutfox.org/
*-- VFP9 Beta disponible gratuitement
Téléchargez la ici : http://msdn.microsoft.com/vfoxpro/
http://www.foxforum.net/
http://www.foxprofr.com/


Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Tue Nov 30 04:52:57 CST 2004

Thanks for the help
but it was already set

my app "quits" and closes the debugger and Vfp
without any message or warning.
I think it quits or maybe it won't start,
I did't envestigate because of the "real" problem.


regards
christophe

"Frédéric Steczycki [AtoutFox]" <frederic.steczycki@nowhere.org> schreef in
bericht news:%23PeeNYs1EHA.2180@TK2MSFTNGP10.phx.gbl...
> Bonjour christophe, Stefan
>
> PMJI,
>
>
> Set the debugger in its frame
>
> VFP, menu 'Tools', Debug tab, Environment : Debug frame
>
> don't forget to "set as default"
>
> depending VFP version, debug in Foxpro frame was not that stable and gave
Dr
> Watson, AKA C..5
>
> HTH
>
> Fred
>
> Pour mémoire, tu nous as écrit :
>
> > Oh I see,
> >
> > I used a combination of low level file functions
> > and messagebox.
> > Because like i mentioned for some reason I can't get
> > my app working with the debugger.
> >
> > regards
> > christophe
> >
>
>
> --
> - Fred
> FE AVP&Cie
> MS VFP MVP
> email : http://cerbermail.com/?jWyjWqURpf
> Membre actif d'AtoutFox,
> Communauté Francophone des Professionnels FoxPro
> http://www.atoutfox.org/
> *-- VFP9 Beta disponible gratuitement
> Téléchargez la ici : http://msdn.microsoft.com/vfoxpro/
> http://www.foxforum.net/
> http://www.foxprofr.com/
>



Re: PARENT is not an object (Vfp bug?) by Stefan

Stefan
Wed Dec 01 09:23:54 CST 2004


"christophe" <irs.znospamforme@skynet.be> schrieb
<...>
>
> At least I can say Thanks A Lot For The Help.

You're welcome.

> Problem "solved" but I'm afraid it will certainly popup again,
> somewhere else....

I'd start by investigating why the debugger closes / does not work
with your particular code. It's a real time saver.

>> IME when such "mysterious" things happened and I finally tracked
>> them down hopefully, usually it turns out to be a bug in my own
>> custom code. Say some 110%
>
> In the past I would certainly agree
> only this one, I'm not sure...

Then we probably would need a repro, no alternative that I
can think of in the moment..


Regards
-Stefan

Re: PARENT is not an object (Vfp bug?) by Mike

Mike
Thu Dec 02 02:01:25 CST 2004

On Mon, 29 Nov 2004 11:26:21 +0100, "christophe"
<irs.znospamforme@skynet.be> wrote:

>Hi,
>
>I got this error on the last line ?!
>anybody an idea.
>
>procedure selectme
>Lparameters loselectme
>If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> Return .F.
>Endif
>lSelectLongName = loselectme.Parent.Name + loselectme.Name
>...
>
>I can say a lot about this on how it works
>and at the same moment I don't have any clue !
>This seems to bug a Vfp bug ?!
>Because the code is quite clear I think.
>
>So anyway I will try to explain the whole picture.
>This procedure is from a "multiselectme"class I created.
>I place this class on a form and call it when I want
>to visually highlight an object.
>(I visually highlight one or more objects by adding on each corner
>a highlighter =small rectangular shape in a bright color)
>
>the procedure is called something like this :
>procedure myobject.rightclick
>thisform.multiselect.selectme(this)
>*dosomethingelse
>thisform.multiselect.deselectme(this)
>
>I only get this error when the user
>Rclicks on the object when the form is not active !
>So when the user first clicks on the form to activate it and then
>Rclick on the object I don't get an error.
>But of course I can't teach my user to do it this way.
>
>So I tried to activate the form in the Rclick prior to
>thisform.mulitselect.selectme
>but whether I use This or Thisform I get the same error.
>
>So has anybody an idea ?
Hi Christophe,
Apologies for the slow response.

I have had this error more than once, and it is _always_ my code :-)
The message has always told the truth. The key to your problem is that
the form is not active. Something else is the active object when you
Rclick, and it's Parent is not an object. You need to trace that.

Trying to activate the form after the Rclick has fired is too late.
The Parent of the object will not change. You would need to know what
the user wanted to Rclick (impossible) and fire the Rclick for that
control.

I find the debugger is a pig. Difficult to use, slow, and often
distorts processing so that it returns different results from a
program. I have used it quite a lot, but it has become a tool of last
resort. My main method now is to use breakpoint I insert in my code. A
command line fires a utility which Lists Memo, Stat and the procedure
hierarchy to0 a text file, then displays a wait window with procedure
name and lineno(). A Y keyed then triggers Suspend so I can pull
things together in more detail - particularly testing conditions.

I suggest you try putting a suspend into your called procedure before
the line that gives theerror, then test what this.name returns.

HTH,
Mike.

Re: PARENT is not an object (Vfp bug?) by Cy

Cy
Fri Dec 03 17:14:15 CST 2004

Mike McDowall wrote:
> On Mon, 29 Nov 2004 11:26:21 +0100, "christophe"
> <irs.znospamforme@skynet.be> wrote:
>
>
>>Hi,
>>
>>I got this error on the last line ?!
>>anybody an idea.
>>
>>procedure selectme
>>Lparameters loselectme
>>If TYPE("loselectme") <> "O" .or. isnull(loselectme)
>>Return .F.
>>Endif
>>lSelectLongName = loselectme.Parent.Name + loselectme.Name
>>...
>>
>>I can say a lot about this on how it works
>>and at the same moment I don't have any clue !
>>This seems to bug a Vfp bug ?!
>>Because the code is quite clear I think.
>>
>>So anyway I will try to explain the whole picture.
>>This procedure is from a "multiselectme"class I created.
>>I place this class on a form and call it when I want
>>to visually highlight an object.
>>(I visually highlight one or more objects by adding on each corner
>>a highlighter =small rectangular shape in a bright color)
>>
>>the procedure is called something like this :
>>procedure myobject.rightclick
>>thisform.multiselect.selectme(this)
>>*dosomethingelse
>>thisform.multiselect.deselectme(this)
>>
>>I only get this error when the user
>>Rclicks on the object when the form is not active !
>>So when the user first clicks on the form to activate it and then
>>Rclick on the object I don't get an error.
>>But of course I can't teach my user to do it this way.
>>
>>So I tried to activate the form in the Rclick prior to
>>thisform.mulitselect.selectme
>>but whether I use This or Thisform I get the same error.
>>
>>So has anybody an idea ?
>
> Hi Christophe,
> Apologies for the slow response.
>
> I have had this error more than once, and it is _always_ my code :-)
> The message has always told the truth. The key to your problem is that
> the form is not active. Something else is the active object when you
> Rclick, and it's Parent is not an object. You need to trace that.
>
> Trying to activate the form after the Rclick has fired is too late.
> The Parent of the object will not change. You would need to know what
> the user wanted to Rclick (impossible) and fire the Rclick for that
> control.
>
> I find the debugger is a pig. Difficult to use, slow, and often
> distorts processing so that it returns different results from a
> program. I have used it quite a lot, but it has become a tool of last
> resort. My main method now is to use breakpoint I insert in my code. A
> command line fires a utility which Lists Memo, Stat and the procedure
> hierarchy to0 a text file, then displays a wait window with procedure
> name and lineno(). A Y keyed then triggers Suspend so I can pull
> things together in more detail - particularly testing conditions.
>
> I suggest you try putting a suspend into your called procedure before
> the line that gives theerror, then test what this.name returns.
I would think that you would want to chech to see if object.parent was
of type object AND that that the property your trying to work with is of
the proper type as well.

--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com

Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Mon Dec 06 02:39:59 CST 2004

> I would think that you would want to chech to see if object.parent was
> of type object AND that that the property your trying to work with is of
> the proper type as well.
>
> --
> Cy Welch
> Senior Programmer
> MetSYS Inc
> http://www.metsysinc.com

thanks for the tip and that's exactly what I've done now :

this is what I've added and seems to work.
I know it's not a real solution it's more a workaround.
because I still get the weird behaviour but without an error
message. The result is that the user needs to Rclick again.
because the first one (with previously resulting in an error)
is trapped with this code and returns .f.
and the second one go further on but doesn't get trapped
by the error and that is still weird why the first click is different
then the second one right after eachother.

procedure Rclick
thisform.selectme(this)

procedure selectme
lparameters loselectme
If TYPE("loselectme") <> "O" .or. isnull(loselectme)
Return .F.
Endif
IF loselectme.baseclass = "Form"
RETURN .f.
endif
IF .not. pemstatus(planmain,"Parent",5)
RETURN .f.
ENDIF
IF TYPE("loselectme.Parent") <> "O"
RETURN .f.
endif



Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Mon Dec 06 02:30:28 CST 2004

Mike,

I was slowly thinking in the same direction,
it was slowly, because a lot of threats
in this NG adviced to use the debugger...
Now I'm a bit more convinced that it's not always the best
solution, so I certainly stick with my way of debugging
(looks a lot like yours except for the Wait Window I can't use because
the Wait Window needs the _Screen and I hide it.)

Thanks a lot,
regards
christophe


"Mike McDowall" <m.a.mcdowall@ed.com> schreef in bericht
news:d7itq05cff25k5e703gvthipb43847p421@4ax.com...
> On Mon, 29 Nov 2004 11:26:21 +0100, "christophe"
> <irs.znospamforme@skynet.be> wrote:
>
> >Hi,
> >
> >I got this error on the last line ?!
> >anybody an idea.
> >
> >procedure selectme
> >Lparameters loselectme
> >If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> > Return .F.
> >Endif
> >lSelectLongName = loselectme.Parent.Name + loselectme.Name
> >...
> >
> >I can say a lot about this on how it works
> >and at the same moment I don't have any clue !
> >This seems to bug a Vfp bug ?!
> >Because the code is quite clear I think.
> >
> >So anyway I will try to explain the whole picture.
> >This procedure is from a "multiselectme"class I created.
> >I place this class on a form and call it when I want
> >to visually highlight an object.
> >(I visually highlight one or more objects by adding on each corner
> >a highlighter =small rectangular shape in a bright color)
> >
> >the procedure is called something like this :
> >procedure myobject.rightclick
> >thisform.multiselect.selectme(this)
> >*dosomethingelse
> >thisform.multiselect.deselectme(this)
> >
> >I only get this error when the user
> >Rclicks on the object when the form is not active !
> >So when the user first clicks on the form to activate it and then
> >Rclick on the object I don't get an error.
> >But of course I can't teach my user to do it this way.
> >
> >So I tried to activate the form in the Rclick prior to
> >thisform.mulitselect.selectme
> >but whether I use This or Thisform I get the same error.
> >
> >So has anybody an idea ?
> Hi Christophe,
> Apologies for the slow response.
>
> I have had this error more than once, and it is _always_ my code :-)
> The message has always told the truth. The key to your problem is that
> the form is not active. Something else is the active object when you
> Rclick, and it's Parent is not an object. You need to trace that.
>
> Trying to activate the form after the Rclick has fired is too late.
> The Parent of the object will not change. You would need to know what
> the user wanted to Rclick (impossible) and fire the Rclick for that
> control.
>
> I find the debugger is a pig. Difficult to use, slow, and often
> distorts processing so that it returns different results from a
> program. I have used it quite a lot, but it has become a tool of last
> resort. My main method now is to use breakpoint I insert in my code. A
> command line fires a utility which Lists Memo, Stat and the procedure
> hierarchy to0 a text file, then displays a wait window with procedure
> name and lineno(). A Y keyed then triggers Suspend so I can pull
> things together in more detail - particularly testing conditions.
>
> I suggest you try putting a suspend into your called procedure before
> the line that gives theerror, then test what this.name returns.
>
> HTH,
> Mike.



Re: PARENT is not an object (Vfp bug?) by Fred

Fred
Mon Dec 06 08:59:27 CST 2004

WAIT WINDOW does not require the _SCREEN to be visible.

--
Fred
Microsoft Visual FoxPro MVP


"christophe" <irs.znospamforme@skynet.be> wrote in message
news:%23SqDru42EHA.4028@TK2MSFTNGP15.phx.gbl...
> Mike,
>
> I was slowly thinking in the same direction,
> it was slowly, because a lot of threats
> in this NG adviced to use the debugger...
> Now I'm a bit more convinced that it's not always the best
> solution, so I certainly stick with my way of debugging
> (looks a lot like yours except for the Wait Window I can't use because
> the Wait Window needs the _Screen and I hide it.)
>
> Thanks a lot,
> regards
> christophe
>
>
> "Mike McDowall" <m.a.mcdowall@ed.com> schreef in bericht
> news:d7itq05cff25k5e703gvthipb43847p421@4ax.com...
>> On Mon, 29 Nov 2004 11:26:21 +0100, "christophe"
>> <irs.znospamforme@skynet.be> wrote:
>>
>> >Hi,
>> >
>> >I got this error on the last line ?!
>> >anybody an idea.
>> >
>> >procedure selectme
>> >Lparameters loselectme
>> >If TYPE("loselectme") <> "O" .or. isnull(loselectme)
>> > Return .F.
>> >Endif
>> >lSelectLongName = loselectme.Parent.Name + loselectme.Name
>> >...
>> >
>> >I can say a lot about this on how it works
>> >and at the same moment I don't have any clue !
>> >This seems to bug a Vfp bug ?!
>> >Because the code is quite clear I think.
>> >
>> >So anyway I will try to explain the whole picture.
>> >This procedure is from a "multiselectme"class I created.
>> >I place this class on a form and call it when I want
>> >to visually highlight an object.
>> >(I visually highlight one or more objects by adding on each corner
>> >a highlighter =small rectangular shape in a bright color)
>> >
>> >the procedure is called something like this :
>> >procedure myobject.rightclick
>> >thisform.multiselect.selectme(this)
>> >*dosomethingelse
>> >thisform.multiselect.deselectme(this)
>> >
>> >I only get this error when the user
>> >Rclicks on the object when the form is not active !
>> >So when the user first clicks on the form to activate it and then
>> >Rclick on the object I don't get an error.
>> >But of course I can't teach my user to do it this way.
>> >
>> >So I tried to activate the form in the Rclick prior to
>> >thisform.mulitselect.selectme
>> >but whether I use This or Thisform I get the same error.
>> >
>> >So has anybody an idea ?
>> Hi Christophe,
>> Apologies for the slow response.
>>
>> I have had this error more than once, and it is _always_ my code :-)
>> The message has always told the truth. The key to your problem is that
>> the form is not active. Something else is the active object when you
>> Rclick, and it's Parent is not an object. You need to trace that.
>>
>> Trying to activate the form after the Rclick has fired is too late.
>> The Parent of the object will not change. You would need to know what
>> the user wanted to Rclick (impossible) and fire the Rclick for that
>> control.
>>
>> I find the debugger is a pig. Difficult to use, slow, and often
>> distorts processing so that it returns different results from a
>> program. I have used it quite a lot, but it has become a tool of last
>> resort. My main method now is to use breakpoint I insert in my code. A
>> command line fires a utility which Lists Memo, Stat and the procedure
>> hierarchy to0 a text file, then displays a wait window with procedure
>> name and lineno(). A Y keyed then triggers Suspend so I can pull
>> things together in more detail - particularly testing conditions.
>>
>> I suggest you try putting a suspend into your called procedure before
>> the line that gives theerror, then test what this.name returns.
>>
>> HTH,
>> Mike.
>
>



Re: PARENT is not an object (Vfp bug?) by christophe

christophe
Tue Dec 07 02:23:45 CST 2004

hm, yes
I kind of misphrased it (if that word exist in english)
I ment, when the _Screen is hidden and there are several forms As Top ...
the Wait Window behaves a bit weird, or at least I could get it right.

regards
christophe


"Fred Taylor" <ftaylor@mvps.org!REMOVE> schreef in bericht
news:ePCUvQ62EHA.3472@TK2MSFTNGP09.phx.gbl...
> WAIT WINDOW does not require the _SCREEN to be visible.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "christophe" <irs.znospamforme@skynet.be> wrote in message
> news:%23SqDru42EHA.4028@TK2MSFTNGP15.phx.gbl...
> > Mike,
> >
> > I was slowly thinking in the same direction,
> > it was slowly, because a lot of threats
> > in this NG adviced to use the debugger...
> > Now I'm a bit more convinced that it's not always the best
> > solution, so I certainly stick with my way of debugging
> > (looks a lot like yours except for the Wait Window I can't use because
> > the Wait Window needs the _Screen and I hide it.)
> >
> > Thanks a lot,
> > regards
> > christophe
> >
> >
> > "Mike McDowall" <m.a.mcdowall@ed.com> schreef in bericht
> > news:d7itq05cff25k5e703gvthipb43847p421@4ax.com...
> >> On Mon, 29 Nov 2004 11:26:21 +0100, "christophe"
> >> <irs.znospamforme@skynet.be> wrote:
> >>
> >> >Hi,
> >> >
> >> >I got this error on the last line ?!
> >> >anybody an idea.
> >> >
> >> >procedure selectme
> >> >Lparameters loselectme
> >> >If TYPE("loselectme") <> "O" .or. isnull(loselectme)
> >> > Return .F.
> >> >Endif
> >> >lSelectLongName = loselectme.Parent.Name + loselectme.Name
> >> >...
> >> >
> >> >I can say a lot about this on how it works
> >> >and at the same moment I don't have any clue !
> >> >This seems to bug a Vfp bug ?!
> >> >Because the code is quite clear I think.
> >> >
> >> >So anyway I will try to explain the whole picture.
> >> >This procedure is from a "multiselectme"class I created.
> >> >I place this class on a form and call it when I want
> >> >to visually highlight an object.
> >> >(I visually highlight one or more objects by adding on each corner
> >> >a highlighter =small rectangular shape in a bright color)
> >> >
> >> >the procedure is called something like this :
> >> >procedure myobject.rightclick
> >> >thisform.multiselect.selectme(this)
> >> >*dosomethingelse
> >> >thisform.multiselect.deselectme(this)
> >> >
> >> >I only get this error when the user
> >> >Rclicks on the object when the form is not active !
> >> >So when the user first clicks on the form to activate it and then
> >> >Rclick on the object I don't get an error.
> >> >But of course I can't teach my user to do it this way.
> >> >
> >> >So I tried to activate the form in the Rclick prior to
> >> >thisform.mulitselect.selectme
> >> >but whether I use This or Thisform I get the same error.
> >> >
> >> >So has anybody an idea ?
> >> Hi Christophe,
> >> Apologies for the slow response.
> >>
> >> I have had this error more than once, and it is _always_ my code :-)
> >> The message has always told the truth. The key to your problem is that
> >> the form is not active. Something else is the active object when you
> >> Rclick, and it's Parent is not an object. You need to trace that.
> >>
> >> Trying to activate the form after the Rclick has fired is too late.
> >> The Parent of the object will not change. You would need to know what
> >> the user wanted to Rclick (impossible) and fire the Rclick for that
> >> control.
> >>
> >> I find the debugger is a pig. Difficult to use, slow, and often
> >> distorts processing so that it returns different results from a
> >> program. I have used it quite a lot, but it has become a tool of last
> >> resort. My main method now is to use breakpoint I insert in my code. A
> >> command line fires a utility which Lists Memo, Stat and the procedure
> >> hierarchy to0 a text file, then displays a wait window with procedure
> >> name and lineno(). A Y keyed then triggers Suspend so I can pull
> >> things together in more detail - particularly testing conditions.
> >>
> >> I suggest you try putting a suspend into your called procedure before
> >> the line that gives theerror, then test what this.name returns.
> >>
> >> HTH,
> >> Mike.
> >
> >
>
>



Re: PARENT is not an object (Vfp bug?) by Andy

Andy
Tue Dec 14 19:19:57 CST 2004


"christophe" <irs.znospamforme@skynet.be> wrote in message
news:ucXpcYD3EHA.2192@TK2MSFTNGP14.phx.gbl...
> hm, yes
> I kind of misphrased it (if that word exist in english)
> I ment, when the _Screen is hidden and there are several forms As Top ...
> the Wait Window behaves a bit weird, or at least I could get it right.
>
> regards
> christophe
>

Do this to show the WAIT WINDOWS (from the Universal Thread):
If you've upgraded to VFP 6.0, you may have noticed that calls
to WAIT WINDOW don't display the window with an SDI form. This will occur if
the form's ShowWindow property is set to 2 (As Top-Level Form) and the
Desktop property is set to .T. Since the Desktop property is ignored when
ShowWindow is set to 2, you may safely re-set the property to its default
.F. This will restore VFP's showing of the WAIT WINDOW in the SDI form.

Andy Rice
San Diego, CA