Menu

Home

James Hardaker

Example:

[<ReflectedDefinition>] 
module Functions =

    //must declare delegate with same name as let bound function
    type Add = delegate of int * int -> int      
    let Add(a,b) = a + b

open Functions
module Host =
    let main() =
        //get function pointer to exported C++ function
        let m = FunctionPointer<Add>
        Assert.AreEqual(m.Invoke(1,2),Add(1,2))

Supported F# Language Features
Unsupported F# Language Features