Search code examples
c#.netvisual-foxpro

deploy DLL in Visual Fox Pro application


i have a visual fox pro 9 application that i need to connect it to a .net 3.5 dll I am not being able to add it in the project.

Can anyone help me with this..

Thank you


Solution

  • VFP cannot use .NET assemblies directly. They can use them through COM, web services, or other interop layers.

    There are third-party libraries out there that act as a "bridge" between VFP and .NET by exposing the .NET types through late-bound calls (e.g. CreateInstance("MyDotNetObject")) but there is no "native" support for .NET within VFP.

    If you want to roll your own bridge one straightforward way would be:

    • Create a .NET library that references the other .NET library
    • Add classes that are COM-visible and pass-through the calls to the other library
    • Create instances of the interop class(es) by using CreateObject in VFP.

    You can read this article for more information, or just search for "VFP COM interop" to find other examples.