IR
irwinrodriguez.dev
Back to docs

FoxBridge

FoxBridge is an interoperability bridge that brings the .NET ecosystem directly into Visual FoxPro. With FoxBridge you can instantiate any .NET class, call methods, read properties, work with generic collections (List<T>, Dictionary<K,V>), invoke static members and consume async/await, all from the comfort of your existing VFP code.

In this section

  • Installation — Requirements, required files and initial setup.
  • Quick Start — Your first .NET object from VFP in under 5 minutes.
  • Examples — 20 progressive examples: from StringBuilder to HttpClient and async/await.
  • API Reference — Complete reference for the FoxBridge class and collection proxies.

How it works

FoxBridge consists of two layers: a native DLL (FoxBridgeNE.dll) that exposes the .NET runtime via P/Invoke, and a PRG file (FoxBridge.prg) that wraps those calls in an object-oriented API familiar to any VFP developer.

* Inicializar FoxBridge
loBridge = NEWOBJECT("FoxBridge", "FoxBridge.prg")

* Crear un objeto .NET
loSB = loBridge.Create("System.Text.StringBuilder", "Hola ")
loSB.Append("desde .NET!")
? loSB.ToString()   && -> "Hola desde .NET!"

Key features

  • Instantiation of any .NET type with up to 10 parameters
  • Generic collections: List<T>, Dictionary<K,V>, Array
  • Static members: class methods, properties and fields
  • Automatic overload resolution
  • Transparent async/await support (blocking Tasks)
  • Loading custom DLLs (LoadAssembly)
  • Automatic type coercion from VFP to .NET
  • Enums as integers (no special syntax)

System requirements

Component Requirement
Visual FoxPro9.0 SP2
WindowsWindows 10 / 11 (x86)
.NET8.0 or higher
RAM4 GB minimum
IDE-only licensing License validation only occurs when running from the VFP IDE. When compiling your application as an EXE, FoxBridge operates without verification automatically.