West Wind .NET Tools and Demos
Calling a .Net form in VFP via wwDotNetBridge
Gravatar is a globally recognized avatar based on your email address. Calling a .Net form in VFP via wwDotNetBridge
  Naeem Afzal
  All
  Apr 11, 2018 @ 01:21pm

Hi,

Can we call a .Net form in VFP via wwDotNetBridge ?

Gravatar is a globally recognized avatar based on your email address. re: Calling a .Net form in VFP via wwDotNetBridge
  Rick Strahl
  Naeem Afzal
  Apr 11, 2018 @ 01:45pm

Not directly due to the fact that WPF/WebForms run on their own UI thread.

While you can get WinForms components to launch by launching them on a separate thread and then doing Application.Run(), that usually causes all sorts of other problems eventually with forms not getting and giving up focus correctly etc.

My suggestion if this is something you want to do is to create a separate application (an exe) have have some mechanism for the application to communicate with your FoxPro app - via file messaging, named pipes or something similar essentially implementing a notification system. But I would avoid trying to run a WinForms application within the same EXE as your FoxPro app.

There are a workarounds but they are generally not very stable. You can check out a very old blog post on this subject:

https://weblog.west-wind.com/posts/2004/Aug/02/Automating-a-NET-WinForm-through-COM-Interop

© 1996-2024