Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's wrong?
Message
De
01/10/2004 08:42:46
Km Kwun
Eastop Consultants Limited
Nt, Hong Kong
 
 
À
01/10/2004 07:39:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00947862
Message ID:
00947895
Vues:
15
Hi Fabio,

Thank for confirming that this is a bug of INKEY(1). I solved the problem by replacing it with the SLEEP() API function.

This is an application to monitor the content change of a special shared folder. Every second, it writes a summary of the content change into a new record of a DBF (also displayed on screen using "?") for future analysis. There is neither any form nor control on the screen.

I use a loop rather than the Timer because it is simpler and easier to stepping through to debug.

Very often, the application is run unattendedly as a scheduled task. Therefore "ON SHUTDOWN ..." is necessary so that the running task can be stopped by choosing the STOP option of the Windows Scheduler menu.

KM


>>Can anybody tell me what's wrong with this code? Or, can anybody suggest a workaround?
>>
>>
>>x=.T.
>>On Shutdown x=.F.
>>
>>o=Createobject('MyClass')
>>
>>Define Class MyClass As Custom
>>	Function Init
>>	Do While x
>>		? Datetime()
>>		=Inkey(1)
>>	EndDo
>>EndDefine
>>
>>
>>In either development time or run time, when we try to close the application, VFP crashes!
>>
>>TIA
>
>A bug.
>
>Crash into VFP8 and VFP9b
>
>Preconditions:
>- On Shutdown is not empty
>- VFP wait for a keypress with INKEY() or CHRSAW()
>-
_VFP
process a WM_CLOSE message
>
>A more simple repro:
>
>DECLARE SHORT PostMessage IN user32;
>    INTEGER   hWnd,;
>    INTEGER   Msg,;
>    INTEGER   wParam,;
>    INTEGER   lParam
>
>On Shutdown KEYBOARD '{SPACEBAR}'
>
>=PostMessage(_VFP.hWnd,16,0,0)
>=CHRSAW(1)
>
>
>WorkAround:
>use READ EVENTS
>Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform