In the launched mask (a data dialog) there are a whole series of
quick procedures, including the launch of the dispensing of recipes
by double-clicking from a sub data window. If I exit from this mask I
should, by my logic, return to the initial, basic screen. This is
what happens if I exit after performing any procedure other than
double click. In this case you get the following error ERROR CODE 50
ACCESS VIOLATION ..... DESCRIPTION APPLICATION CODE ERRORCAUSIN
ACCES VIOLATION CALLSTACK: MAINWINDOS LAUNCHES (LINE 13)
(corresponds to : owin:show()) APP:START LINE 443 START: LINE 6
Hi Aurora,
In the launched mask (a data dialog) there are a whole series ofthis may be difficult to find: a GPF like this is occurring most of the
quick procedures, including the launch of the dispensing of recipes
by double-clicking from a sub data window. If I exit from this mask I should, by my logic, return to the initial, basic screen. This is
what happens if I exit after performing any procedure other than
double click. In this case you get the following error ERROR CODE 50 ACCESS VIOLATION ..... DESCRIPTION APPLICATION CODE ERRORCAUSIN
ACCES VIOLATION CALLSTACK: MAINWINDOS LAUNCHES (LINE 13)
(corresponds to : owin:show()) APP:START LINE 443 START: LINE 6
time if you are accessing an object that is being destroyed.
Searching for a GPF cause can be really time consuming....
Wolfgang
--Good evening Mr. Riedman, and thank you always.
Il giorno martedì 22 giugno 2021 alle 16:14:49 UTC+2 Wolfgang
Riedmann ha scritto:
Hi Aurora,
In the launched mask (a data dialog) there are a whole series ofthis may be difficult to find: a GPF like this is occurring most of
quick procedures, including the launch of the dispensing of
recipes by double-clicking from a sub data window. If I exit from
this mask I should, by my logic, return to the initial, basic
screen. This is what happens if I exit after performing any
procedure other than double click. In this case you get the
following error ERROR CODE 50 ACCESS VIOLATION ..... DESCRIPTION APPLICATION CODE ERRORCAUSIN ACCES VIOLATION CALLSTACK:
MAINWINDOS LAUNCHES (LINE 13) (corresponds to : owin:show())
APP:START LINE 443 START: LINE 6
the time if you are accessing an object that is being destroyed.
Searching for a GPF cause can be really time consuming....
Wolfgang
--Good evening Mr. Riedman, and thank you always.
Your conclusion is my conclusion as well.
But the point is that I destroy (with theExit button) the
RequestFiscalCode window and not the mainwindow. I have tried both
Destroy(9 and Endwindow(). And if I don't double click on the
subdatawindow contained in the TaxCodeRequest window everything works normally. And in any case the procedures activated with the double
click are activated and closed regularly. A question: what does GPF
mean? thanks Aurora Baccio
Hi Aurora,
a GPF is a general protection failure - VO calls it "access violation".
It basically means that a process tries to access memory that is
outside of its memory space.
Since VO's memory is handled by its own dynamic memory system, normally
this means that the program tries to access objects that are already destroyed.
Unfortunately I cannot say more without seeing the entire logic, but I suspect that a reference to the RequestFiscalCode window is stored
somewhere and your code tries to access it nevertheless it is already garbage collected.
A call to the Destroy() method should only be used in rare cases - it
was requested in earlier VO versions to cleanup Windows ressources like fonts or pens. But you should never call the Destroy() method on a
window or control class.
Wolfgang
aurora baccio wrote:
Il giorno martedì 22 giugno 2021 alle 16:14:49 UTC+2 Wolfgang
Riedmann ha scritto:
Hi Aurora,
In the launched mask (a data dialog) there are a whole series ofthis may be difficult to find: a GPF like this is occurring most of
quick procedures, including the launch of the dispensing of
recipes by double-clicking from a sub data window. If I exit from
this mask I should, by my logic, return to the initial, basic
screen. This is what happens if I exit after performing any
procedure other than double click. In this case you get the
following error ERROR CODE 50 ACCESS VIOLATION ..... DESCRIPTION APPLICATION CODE ERRORCAUSIN ACCES VIOLATION CALLSTACK:
MAINWINDOS LAUNCHES (LINE 13) (corresponds to : owin:show())
APP:START LINE 443 START: LINE 6
the time if you are accessing an object that is being destroyed.
Searching for a GPF cause can be really time consuming....
Wolfgang
----Good evening Mr. Riedman, and thank you always.
Your conclusion is my conclusion as well.
But the point is that I destroy (with theExit button) the RequestFiscalCode window and not the mainwindow. I have tried both Destroy(9 and Endwindow(). And if I don't double click on the subdatawindow contained in the TaxCodeRequest window everything works normally. And in any case the procedures activated with the double
click are activated and closed regularly. A question: what does GPF
mean? thanks Aurora Baccio
going by logic the problem arises only after double click in the subdatawindow01 > AAdd(aParam,self:Owner:Server:CodOperato)
here is the method :
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the subdatawindow
here is the method :01 > AAdd(aParam,self:Owner:Server:CodOperato)
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning
it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the self:Owner and use this variable instead of the self:Owner:Owner
- store the shell window (this should be the self:Owner:Owner?) to a
sort of global and retrieve it always from them.
Wolfgang
--
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the01 > AAdd(aParam,self:Owner:Server:CodOperato)
subdatawindow
here is the method :
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning
it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the
self:Owner and use this variable instead of the self:Owner:Owner
- store the shell window (this should be the self:Owner:Owner?) to a
sort of global and retrieve it always from them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click method
*DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy()
as you can see they have been disabled and the problem has disappeared.
These two lines should destroy the whole mask named RequestFiscalCode, a data dialog in which there is the list of appointments of the day, displayed in a subdatawindow.
The first self:Owner should close the subData, while the second should close the datadialog, at least I think so since the entire mask disappears.
Once the two lines are deleted, the datadialog remains active, as does the subdata.
At the end of the procedure I would like to reset it, how do I do it?
thanks
Aurora Baccio
If you are "ready" with your dialog because you have finished in a
method what you want to do just call SELF:EndDialog()
John
Op 24-6-2021 om 15:58 schreef aurora baccio:
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the01 > AAdd(aParam,self:Owner:Server:CodOperato)
subdatawindow
here is the method :
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning >> it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the
self:Owner and use this variable instead of the self:Owner:Owner
- store the shell window (this should be the self:Owner:Owner?) to a
sort of global and retrieve it always from them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click method
*DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy()
as you can see they have been disabled and the problem has disappeared. These two lines should destroy the whole mask named RequestFiscalCode, a data dialog in which there is the list of appointments of the day, displayed in a subdatawindow.
The first self:Owner should close the subData, while the second should close the datadialog, at least I think so since the entire mask disappears.
Once the two lines are deleted, the datadialog remains active, as does the subdata.
At the end of the procedure I would like to reset it, how do I do it? thanks
Aurora Baccio
Il giorno giovedì 24 giugno 2021 alle 18:32:31 UTC+2 JohnMartens ha scritto:
If you are "ready" with your dialog because you have finished in agood evening,
method what you want to do just call SELF:EndDialog()
John
Op 24-6-2021 om 15:58 schreef aurora baccio:
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the01 > AAdd(aParam,self:Owner:Server:CodOperato)
subdatawindow
here is the method :
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning >>>> it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the >>>> self:Owner and use this variable instead of the self:Owner:Owner
- store the shell window (this should be the self:Owner:Owner?) to a
sort of global and retrieve it always from them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click method
*DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy()
as you can see they have been disabled and the problem has disappeared.
These two lines should destroy the whole mask named RequestFiscalCode, a data dialog in which there is the list of appointments of the day, displayed in a subdatawindow.
The first self:Owner should close the subData, while the second should close the datadialog, at least I think so since the entire mask disappears.
Once the two lines are deleted, the datadialog remains active, as does the subdata.
At the end of the procedure I would like to reset it, how do I do it?
thanks
Aurora Baccio
I had already tried this solution
here is the answer that I cannot solve
Visual Objects (Version 2.8. Build 3.2838), Version 2.8 SP4b
24-06-2021 19:08:27
Application: c:\Prg28CardioReceipt.DBG
Error message:
--------------
Error Code: 13 [ NO EXPORTED METHOD ].
Subsystem: BASE
Function: SEND
Argument: SEND_MASCHERA:ENDDIALOG
CallStack:
SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17)
MAINWINDOW:LAUNCH (Line:13)
APP:START (Line:441)
START (Line:6)
Translated with www.DeepL.com/Translator (free version)
And what is the code in CellDoubleClick so we can see SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17) ?
Op 24-6-2021 om 19:12 schreef aurora baccio:
Il giorno giovedì 24 giugno 2021 alle 18:32:31 UTC+2 JohnMartens ha scritto:
If you are "ready" with your dialog because you have finished in agood evening,
method what you want to do just call SELF:EndDialog()
John
Op 24-6-2021 om 15:58 schreef aurora baccio:
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the01 > AAdd(aParam,self:Owner:Server:CodOperato)
subdatawindow
here is the method :
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning >>>> it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the >>>> self:Owner and use this variable instead of the self:Owner:Owner
- store the shell window (this should be the self:Owner:Owner?) to a >>>> sort of global and retrieve it always from them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click method
*DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy()
as you can see they have been disabled and the problem has disappeared. >>> These two lines should destroy the whole mask named RequestFiscalCode, a data dialog in which there is the list of appointments of the day, displayed in a subdatawindow.
The first self:Owner should close the subData, while the second should close the datadialog, at least I think so since the entire mask disappears.
Once the two lines are deleted, the datadialog remains active, as does the subdata.
At the end of the procedure I would like to reset it, how do I do it? >>> thanks
Aurora Baccio
I had already tried this solution
here is the answer that I cannot solve
Visual Objects (Version 2.8. Build 3.2838), Version 2.8 SP4b
24-06-2021 19:08:27
Application: c:\Prg28CardioReceipt.DBG
Error message:
--------------
Error Code: 13 [ NO EXPORTED METHOD ].
Subsystem: BASE
Function: SEND
Argument: SEND_MASCHERA:ENDDIALOG
CallStack:
SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17)
MAINWINDOW:LAUNCH (Line:13)
APP:START (Line:441)
START (Line:6)
Translated with www.DeepL.com/Translator (free version)
Il giorno giovedì 24 giugno 2021 alle 21:35:56 UTC+2 JohnMartens ha scritto:
And what is the code in CellDoubleClick so we can see
SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17) ?
Op 24-6-2021 om 19:12 schreef aurora baccio:
Il giorno giovedì 24 giugno 2021 alle 18:32:31 UTC+2 JohnMartens ha scritto:
If you are "ready" with your dialog because you have finished in agood evening,
method what you want to do just call SELF:EndDialog()
John
Op 24-6-2021 om 15:58 schreef aurora baccio:
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the >>>>>>> subdatawindow01 > AAdd(aParam,self:Owner:Server:CodOperato)
here is the method :
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning >>>>>> it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the >>>>>> self:Owner and use this variable instead of the self:Owner:Owner
- store the shell window (this should be the self:Owner:Owner?) to a >>>>>> sort of global and retrieve it always from them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click method
*DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy()
as you can see they have been disabled and the problem has disappeared. >>>>> These two lines should destroy the whole mask named RequestFiscalCode, a data dialog in which there is the list of appointments of the day, displayed in a subdatawindow.
The first self:Owner should close the subData, while the second should close the datadialog, at least I think so since the entire mask disappears.
Once the two lines are deleted, the datadialog remains active, as does the subdata.
At the end of the procedure I would like to reset it, how do I do it? >>>>> thanks
Aurora Baccio
I had already tried this solution
here is the answer that I cannot solve
Visual Objects (Version 2.8. Build 3.2838), Version 2.8 SP4b
24-06-2021 19:08:27
Application: c:\Prg28CardioReceipt.DBG
Error message:
--------------
Error Code: 13 [ NO EXPORTED METHOD ].
Subsystem: BASE
Function: SEND
Argument: SEND_MASCHERA:ENDDIALOG
CallStack:
SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17)
MAINWINDOW:LAUNCH (Line:13)
APP:START (Line:441)
START (Line:6)
Translated with www.DeepL.com/Translator (free version)
AAdd(aParam,self:Owner:Server:CodOperato)
AAdd(aParam,self:Owner:Server:CodFisc)
AAdd(aParam,4) // parte da doppio click
AAdd(aParam,self:Owner:Posiz)
DeleteChildWindow(self:Owner:Caption)
self:Owner:Owner:EndDialog() //Destroy()
oMenuDemNuovo := MenuDemNuovo_Maschera{self:Owner:Owner:Owner,,,aParam}
FabCenterWindow(oMenuDemNuovo)
oMenuDemNuovo:Show()
I'm not a VO guru like Wolfgang but some remarks
I never use DeleteChildWindow(self:Owner:Caption). I always close/end
the window and let VO clear up the rest
I never close the owner of a window like self:Owner:Owner:EndDialog() Closing fomr bottom up is what I normaly do. so I use SELF:EndDialog(),
the you get back to the owner which sould close itself and then back to
the owner of the owner
Looks like you want to pull away the tablecloth without removing the tableware first
John
Op 25-6-2021 om 14:41 schreef aurora baccio:
Il giorno giovedì 24 giugno 2021 alle 21:35:56 UTC+2 JohnMartens ha scritto:
And what is the code in CellDoubleClick so we can see
SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17) ?
Op 24-6-2021 om 19:12 schreef aurora baccio:
Il giorno giovedì 24 giugno 2021 alle 18:32:31 UTC+2 JohnMartens ha scritto:
If you are "ready" with your dialog because you have finished in agood evening,
method what you want to do just call SELF:EndDialog()
John
Op 24-6-2021 om 15:58 schreef aurora baccio:
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the >>>>>>> subdatawindow01 > AAdd(aParam,self:Owner:Server:CodOperato)
here is the method :
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are cleaning
it effectively up.
But in line 10 you are accessing a member of an already destroyed >>>>>> window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying the
self:Owner and use this variable instead of the self:Owner:Owner >>>>>> - store the shell window (this should be the self:Owner:Owner?) to a >>>>>> sort of global and retrieve it always from them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click method
*DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy()
as you can see they have been disabled and the problem has disappeared.
These two lines should destroy the whole mask named RequestFiscalCode, a data dialog in which there is the list of appointments of the day, displayed in a subdatawindow.
The first self:Owner should close the subData, while the second should close the datadialog, at least I think so since the entire mask disappears.
Once the two lines are deleted, the datadialog remains active, as does the subdata.
At the end of the procedure I would like to reset it, how do I do it? >>>>> thanks
Aurora Baccio
I had already tried this solution
here is the answer that I cannot solve
Visual Objects (Version 2.8. Build 3.2838), Version 2.8 SP4b
24-06-2021 19:08:27
Application: c:\Prg28CardioReceipt.DBG
Error message:
--------------
Error Code: 13 [ NO EXPORTED METHOD ].
Subsystem: BASE
Function: SEND
Argument: SEND_MASCHERA:ENDDIALOG
CallStack:
SUBMENUDEMNOW:CELLDOUBLECLICK (Line:17)
MAINWINDOW:LAUNCH (Line:13)
APP:START (Line:441)
START (Line:6)
Translated with www.DeepL.com/Translator (free version)
AAdd(aParam,self:Owner:Server:CodOperato) AAdd(aParam,self:Owner:Server:CodFisc)
AAdd(aParam,4) // parte da doppio click
AAdd(aParam,self:Owner:Posiz)
DeleteChildWindow(self:Owner:Caption)
self:Owner:Owner:EndDialog() //Destroy()
oMenuDemNuovo := MenuDemNuovo_Maschera{self:Owner:Owner:Owner,,,aParam} FabCenterWindow(oMenuDemNuovo)
oMenuDemNuovo:Show()
good morning Giovanni,
You insist on enddialog, and you are certainly right.
If I write in the double-click method
self:enddialog method, I get a warning at compile time that enddialog is not a method of the submenudemn class.
This means that I have to create an enddialog method
can you give me an example please?
Thank you for your patience.
I searched in help, but this is all I could find
METHOD ButtonClick(oEvent) CLASS MyDialogWindow
IF oEvent:nControlID == ID_OK
SELF:EndDialog(1)
ENDIF
IF oEvent:nControlID == ID_CANCEL
SELF:EndDialog(0)
ENDIF
Aurora Baccio
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang
Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the subdatawindow
here is the method :01 > AAdd(aParam,self:Owner:Server:CodOperato)
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are
cleaning it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying
the self:Owner and use this variable instead of the
self:Owner:Owner - store the shell window (this should be the self:Owner:Owner?) to a sort of global and retrieve it always from
them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my
problems are these two lines of code contained in the double-click
method *DeleteChildWindow(self:Owner:Caption) *self:Owner:Destroy() as you can see they have been disabled and the
problem has disappeared. These two lines should destroy the whole
mask named RequestFiscalCode, a data dialog in which there is the
list of appointments of the day, displayed in a subdatawindow. The
first self:Owner should close the subData, while the second should
close the datadialog, at least I think so since the entire mask
disappears. Once the two lines are deleted, the datadialog remains
active, as does the subdata. At the end of the procedure I would
like to reset it, how do I do it? thanks Aurora Baccio
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang
Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the subdatawindow
here is the method :01 > AAdd(aParam,self:Owner:Server:CodOperato)
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are
cleaning it effectively up.
But in line 10 you are accessing a member of an already destroyed
window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying
the self:Owner and use this variable instead of the
self:Owner:Owner - store the shell window (this should be the self:Owner:Owner?) to a sort of global and retrieve it always from
them.
Wolfgang
--
good morning,
I have come to the conclusion, I hope correct, that the source of my
problems are these two lines of code contained in the double-click
method *DeleteChildWindow(self:Owner:Caption) *self:Owner:Destroy() as you can see they have been disabled and the
problem has disappeared. These two lines should destroy the whole
mask named RequestFiscalCode, a data dialog in which there is the
list of appointments of the day, displayed in a subdatawindow. The
first self:Owner should close the subData, while the second should
close the datadialog, at least I think so since the entire mask
disappears. Once the two lines are deleted, the datadialog remains
active, as does the subdata. At the end of the procedure I would
like to reset it, how do I do it? thanks Aurora Baccio
Hi Aurora,
after thinking again how to explain it better to you, I have two things
to say: (and I will repeat the text below in Italian so you don't need
DeepL to understand)
- first of all: to close a window, don't destroy it, but close it. For dialogs the correct method is :EndDialog(), for windows :EndWindow().
The destructor method (Destroy() in this case) should only be needed in
rare cases.
- second: as I wrote before (please re-read my message!), if you
destroy an object, you cannot access the properties of it anymore. If
you throw your handbag in the sea, you have no access anymore to the
money in your wallet that is in the handbag. In your case, you are destroying self:Owner, but you try to access self:Owner:Owner in the
next codeline.
and now the Italian text:
dopo averci pensato come spiegare meglio, ho due cose da dire:
- prima: se deve chiudere und finestra, non distruggerla con Destroy(),
ma chiuderla correttamente. Per i dialog il metodo da chiamare è EndDialog(), per le Window EndWindow(). Il metodo di distruzione
(Destroy() in questo caso) dovrebbe essere necessario only in casi
veramente rari.
- secondo: come scritto prima (e per favore rilegga il mio messaggio!)
se un oggetto viene distrutto, dopo non si ha più accesso alle
proprietà. Se butta la Sua borsa nel mare, non avrà più accesso ai
soldi che si trovano nel portafoglio nella borsa. Nel Suo caso
distrugge prima self:Owner, e nella prossima riga cerca di accedere a self:Owner:Owner.
HTH
Wolfgang
P.S. if you are not sure that you understand this, please ask again,
maybe better with a private email in Italian (even if I my nationality
is Italian, my mothers language is German, so my Italian is not
perfect).
And I'm far from being a "VO guru" - I have only a few years of
experience with it, so don't expect too much.
aurora baccio wrote:
Il giorno mercoledì 23 giugno 2021 alle 17:12:04 UTC+2 Wolfgang
Riedmann ha scritto:
Hi Aurora,
as I wrote: never call Destroy() on a window.
going by logic the problem arises only after double click in the subdatawindow
here is the method :01 > AAdd(aParam,self:Owner:Server:CodOperato)
02 > AAdd(aParam,self:Owner:Server:CodFisc)
03 > AAdd(aParam,4) // start from double click
04 > AAdd(aParam,"")
05 >
06 > DeleteChildWindow(self:Owner:Caption)
07 > self:Owner:Destroy()
08 >
09 > oMenuDemNew:=
10 > oMenuDemNuovo_Maschera{self:Owner:Owner,,,aParam}
11 > FabCenterWindow(oMenuDemNew)
12 > oMenuDemNew:Show()
this is clear (I have added numbers to the lines):
in line 07 you are calling Destroy() on self:Owner, so you are
cleaning it effectively up.
But in line 10 you are accessing a member of an already destroyed window.
I see at least two possibilities:
- store the self:Owner:Owner to a local variable before destroying
the self:Owner and use this variable instead of the
self:Owner:Owner - store the shell window (this should be the self:Owner:Owner?) to a sort of global and retrieve it always from
them.
Wolfgang
--
good morning,--
I have come to the conclusion, I hope correct, that the source of my problems are these two lines of code contained in the double-click
method *DeleteChildWindow(self:Owner:Caption)
*self:Owner:Destroy() as you can see they have been disabled and the problem has disappeared. These two lines should destroy the whole
mask named RequestFiscalCode, a data dialog in which there is the
list of appointments of the day, displayed in a subdatawindow. The
first self:Owner should close the subData, while the second should
close the datadialog, at least I think so since the entire mask disappears. Once the two lines are deleted, the datadialog remains
active, as does the subdata. At the end of the procedure I would
like to reset it, how do I do it? thanks Aurora Baccio
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (2 / 14) |
Uptime: | 05:19:41 |
Calls: | 6,642 |
Calls today: | 2 |
Files: | 12,190 |
Messages: | 5,325,847 |