Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Destroy event does not fire when form is released
Message
From
16/11/2001 12:17:37
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00582372
Message ID:
00582783
Views:
39
I changed my sample code to the following:

PROCEDURE DESTROY
messagebox('Destroy event of custom class' )
ENDPROC

After running my sample and releasing form, a message box does not appear. Why ?

My class commevents is based on the vfp base class, custom. So placing dodefault() to this class destroy does not change anything.

>If this is a subclass of a class that actually has the Destroy method code, you either need to remove the PROC DESTROY/ENDPROC from Pump.prg or put a DODEFAULT() in it. If Pump.prg just has:
>
>PROCEDURE DESTROY
>
>ENDPROC
>
>with nothing in between, the code in the parent class does not fire. So, put a DODEFAULT() in it or remove those 2 lines.
>
>>I create a comm object and event handler in form init()
>>
>>When the form is closed by clicking upper right corner, event handler Destroy()
>>event does not fire. Why ?
>>
>>
>>* Form Init()
>>this.oComm = createobject( "mscommlib.MSComm" )
>>EVENTHANDLER( this.oComm, NEWOBJECT("commevents", 'pump.prg' ) )
>>
>>
>>
>>* File pump.prg contains:
>>
>>DEFINE CLASS commevents AS custom
>>IMPLEMENTS DMSCommEvents IN "mscommlib.MSComm"
>>
>>procedure Destroy
>>* this event does not fire when form is closed. why ?
>>ENDPROC
>>
>>PROCEDURE DMSCommEvents_OnComm() AS VOID;
>>HELPSTRING "Occurs whenever the value of the CommEvent property changes."
>>ENDPROC
>>ENDDEFINE
>>
Andrus
Previous
Reply
Map
View

Click here to load this message in the networking platform