Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Environment Hook doesn't work in VFP9
Message
De
06/02/2005 10:33:25
 
 
À
06/02/2005 09:32:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00984303
Message ID:
00984306
Vues:
16
>Hi guys,
>
>I found that in VFP9 the following is not working:
>I have de_hook.prg:
>
>[vfp_code]
>PUBLIC oDEHook
>m.oDEHook = CREATEOBJECT ("DEHook")
>RETURN
>
>DEFINE CLASS DEHook AS DataEnvironment
>Name = "DataEnvironment"
>
>PROCEDURE BeforeOpenTables
> Messagebox ("I'm in the hook")
> SET DELETED ON
> SET TALK OFF
> SET CONSOLE OFF
> SET CONFIRM ON
> SET CENTURY ON
> SET CONFIRM OFF
> SET EXCLUSIVE OFF
> SET SAFETY OFF
> SET TALK OFF
> SET MULTILOCKS ON
>ENDPROC
>
>ENDDEFINE
>[/vfp_code]
>
>After I run de_hook.prg in VFP7/8, each time I run any form, the procedure
>BeforeOpenTables in de_hook would run (hence the messagebox appear). But in
>VFP9, the procedure wouldn't run. After I run de_hook, I tried ?m.oDEHook in
>the command window and it returns (Objects) as it should be. Seems like VFP9
>just by pass the hook.
>
>Are there something I miss? Can anybody help me? If this behaviour is by
>design (I hate those sentences, 'by design'), are there any way around?
>
>TIA,
>Willianto
>P.S: I got this method from Igor Korolyov. Hi Igor, have you notice this
>VFP9 behaviour as well?

When you call de_hook.prg ?

I cannot see the message in VFP8 and this is corrected for me,
since for an isolated DE none call the OpenTables method,
then the BeforeOpenTables event cannot happen

Solution:
Put the BeforeOpenTables's code in DEHook.Init.

Fabio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform