>Yeah, that's great !! Thank's Larry :-)
>
>But, when I try to switch the focus to another Form (VB Form) a messagebox (Component Request Pending) appeared : "An action cannot be completed because a component (Visual FoxPro Form) is not responding. Choose "Switch to" to activate the component and correct the problem".
>
>Well, another question ... how can I avoid this message appear ?
The problem you're seeing is because you are directly calling the VFP form and since it is now in a wait state, it isn't returning anything to VB. VB is stuck until VFP exits the Read Events.
This is my fault for not telling you about this but I thought you wanted to bring up VFP, get some input, do some processing and then return to VB. I didn't know you wanted to be able to continue in the VB app as if nothing had happened.
You will need a "wrapper" method in the VFP class to handle this. You will call the wrapper from VB. The functionality will be:
1. Create timer object
2. Return immediately to VB app
Timer object specs
1. Set interval to something very small
2. Set the timer action to call the method that instantiates and displays the form with a Rread Events
3. Destroy the timer object
VB calls VFP. This will set up a chain of events within the VFP out-of-process server itself. The Read Events won't affect the VB thread at all. Now this technique requires that the VFP object be global to the form and not confined to the Click method of the VB form's button. You can create the variable in the declaration section of the form. If you leave it in the Click method, when the method finsihes executing, the VFP object and form will be destroyed.
Good luck! HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao