Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bindevent, Raiseevent, Bindevent... and With
Message
De
02/05/2006 09:05:04
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01118319
Message ID:
01118356
Vues:
12
>Check http://fox.wikis.com/wc.dll?Wiki~WithLeaksLocals
>
Sergey, thanks for the link.

So what should I do? What would be a "best practice" in this case? I am inclined to remove the with...endwith, to prevent those leaking references. Or should I stick with them to speed up object properties access? Considering this is a bindevent to a window message, I want the code to be as fast as possible.

I don't know what to do! What would you do in such a case?


>>Today I discovered something "peculiar"
>>
>>I am doing a Bindevent to a window message, to capture mouse clicks in my statusbar class, like this:
>>
>>
>>Bindevent(.ctl32_ProxyHwnd, WM_NOTIFY, This, [ctl32_MouseEventHandler],1)
>>
>>
>>Inside the ctl32_MouseEventHandler method I have:
>>
>>
>>With This
>>...
>>Raiseevent(This, [Click])
>>...
>>EndWith
>>
>>
>>And the control is placed on a Form that has in its Init event:
>>
>>
>>BindEvent(Thisform.oStatusBar, [Click], This, [StatusBarClick])
>>
>>
>>And in the Form StatusBarClick method I have:
>>
>>
>>?"Click", ;
>>"nButton:" + Transform(.nButton), ;
>>"nPanel:"  + Transform(.nPanel),  ;
>>"nXCoord:" + Transform(.nXCoord), ;
>>"nYCoord:" + Transform(.nYCoord)
>>
>>
>>Now all those properties .nButton, .nPanel, etc. are properties of the control, they are missing the full qualifier like ThisForm.StatusBar.nButton, but it works!
>>
>>Seems like the With...Endwith is inherited from the ctl32_MouseEventHandler method?
>>
>>Carlos
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform