StrataFrame Forum

Strataframe, VFP interop question

http://forum.strataframe.net/Topic11921.aspx

By Marcel Heitlager - 10/8/2007

Hi Guys,

I like that sample vfp, .net interop application that you made available. I have one question though.  I noticed when I run the sample on my machine, once everything has initialized, I have to click the VFP form button, twice before the form pops up. After that I only need to click it once and it pops up.

I've been trying to trace the problem, but it seems like the sendmessage function sends the message out fine, but the VFP udp object never receives the message.

I know that first, I have to click on the main form to put the focus on it, and then click on the button.  But again, once the form has focus, only the very first time, I have to click the button twice to get the form to pop up.

Am I missing something (besides some marbles?)

Thanks,

Marcel

By Trent L. Taylor - 10/9/2007

Very good question!  Actaully, this is something that we addressed by adding some code in the OnMouseOver event of the toolstrip that forces the focus back to the .NET application.

In this sample that was provided, the VFP application is being stuffed into the .NET application.  So it is about window handle management.  The easiest solution here is to just force the focus back over to the .NET application anytime the mouse is over the toolstrip.

MyMainForm.Focus()

If that doesn't work then you can use a Windows API to force the focus back as well.  Let me know if you need more detail. Smile