>When I run it from within VFP7, it works perfectly. I close it and it returns to the command window. So, Read Event is working properly (as you mentioned). But when I close VFP7 and try to run the exe file, It does nothing at all.
There was a misunderstanding here. I meant whether you return to the Command Window BEFORE exiting the application. Now I see the answer is no.
>Clear events is the last instruction of my exit routine.
>So, the problem is when I try to run the exe without opening VFP7
READ EVENTS and CLEAR EVENTS don't seem to be the problem then; it seems everything is set up correctly.
>I did the debug but no problem shows due to the fact that I am running it from withing VFP7
I don't think so. If I understand correctly, you get no error messages - I don't know what else can be wrong.
Debugging is more difficult if you run the executable from outside VFP. I suggest you insert debugging statements of the type WAIT WINDOW (expression) TIMEOUT 1 in a few places, to see whether the code is reached at all, etc.
Otherwise, I am afraid I have no further ideas.
Regards, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)