>Do you have VFP6 sp5?
>Maybe it's fixed in VFP 7.
I have VFP 8.
>Michael, may you take a look at my source codes? I mean this example sources(with 2 forms). I can email it for you.
You can send it to my email. I may have time to look at it.
>1) I have a big project with many OCXs that controls a real (real-time) devices.
>2) On events of that OCXs a have a huge complicated codes. Sometimes that code can call SetFocus() method.
>3) Sometimes the program displays a modal window (dialog). If that time SetFocus() method called - I have a problem.
I'd say it's a design issue. If you have such OCXs that are calling events in a user application, then, I would go back to the drawing board and see how it could be better implemented. The way it is now, it is normal you could have some situations like these.
Basically, depending on what those OCXs are doing, if they run by themselves, then, you'd be better to have them run in a service by themselves and not interfere with a user application. Or, at least, run it independently so it won't run into such situations.