FoxPro and .NET Interop
Hosting a .NET GUI control in Visual Foxpro
Gravatar is a globally recognized avatar based on your email address. Hosting a .NET GUI control in Visual Foxpro
  Paul
  All
  Feb 26, 2020 @ 04:01pm

Hi,

Years ago I used a product called .NET Extender from eTechnologia to host a .NET GUI control in a Foxpro form, in particular a gauge control from Infragistics. The beauty of this is that the control did not need to be registered with COM - this worked well.
I am finally getting around to removing any .NET 2.0 dependencies from the Foxpro project and I need to find an alternative to the .NET Extender product, which the developers abandoned long ago and is stuck on .NET 2.0.

I would rather not go back to using a COM-registered .NET class approach, as looking at my old comments I see that I originally started off using that approach but abandoned it due to intermittent fatal errors in VFP.
Decompiling the old .NET Extender and recompiling for .NET 4.5 is something I would rather not do either, for various reasons, assuming that is even feasible.

I suspect I will need to abandon the hosted concept entirely and move to javascript-based web control in a browser instead, but before I embark on a totally new project I thought I would ask the question :
Is anyone aware of another product or method which will host a .NET control in a Foxpro form?

Thanks

Paul

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Doug Hennig
  Paul
  Mar 11, 2020 @ 04:27pm

You can put the control into a WinForms or WPF form and then call that form from VFP using wwDotNetBridge. I've done that a few times and it works well.

Doug

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Paul
  Doug Hennig
  Mar 11, 2020 @ 08:59pm

Yes, that would work. I could position the .net form inside VFP perhaps.
Looks like I don't use any .net events in this situation, should that approach is a possibility.

Thanks.
Paul

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Rick Strahl
  Doug Hennig
  Mar 11, 2020 @ 10:37pm

Doug,

Have you done this with non-modal forms successfully? I know it works well with Modal forms, but with non-modal forms I end up crashing frequently as the event loops get mixed up, even if starting on a new thread.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Doug Hennig
  Rick Strahl
  Mar 12, 2020 @ 06:37am

Yes, I've used it with a couple of modeless forms. One of them is a WinForms form with a grid displaying a DataTable retrieved from .NET into VFP and then passed to the form. It saved having to convert the DataTable to a cursor and display it in a VFP grid. The only issue I found is that the form doesn't close when the variable it's instantiated into goes out of scope; the user has to manually close the form. However, that's the behavior I want anyway in this case.

Doug

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Rick Strahl
  Doug Hennig
  Mar 13, 2020 @ 11:31am

Interesting. I know I tried that some time ago and ran into lots of weird problems.

Maybe I should revisit. This could be a solution to the Help Builder preview window because I could potentially run that on a different UI thread so the browser wouldn't interact with the main FoxPro thread (which is what's causing all the slowdowns in wwhelp - mostly the dualing browser controls of the editor and preview I bet).

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Noker Lodia
  Doug Hennig
  Apr 27, 2022 @ 07:57pm

Hi Doug,

This is something I am trying to do with Patagames PDFViewer, but, I am not sure how to do that. If you can share any tips, I would greatly appreciate it.

Thank you.

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Doug Hennig
  Noker Lodia
  Apr 28, 2022 @ 06:15am

Not much in the way of specific tips: put the control into a .NET form (WinForms or WPF), build a DLL, and call that DLL from VFP using wwDotNetBridge.

Doug

Gravatar is a globally recognized avatar based on your email address. re: Hosting a .NET GUI control in Visual Foxpro
  Noker Lodia
  Doug Hennig
  Apr 28, 2022 @ 04:03pm

Hi Doug,

I was interested in using the Patagames Pdfium.Net SDK, and I wasn't sure how I was going to make it work in VFP. Your suggestion gave me the roadmap. I have been using wwDotNetBridge for a while, Rick did do a good job with it.

Thanks for your help.

© 1996-2024