How to convert out/ref extern parameters to F#
I've got a C# extern declaration that goes like this: [DllImport("something.dll")] public static extern ReturnCode GetParent(IntPtr inRef, out IntPtr outParentRef); How to translate that to F#? You can try something like the code below. I don't know what ReturnCode is, so the code below expects it is an integer. For any more complex type, you'll need to use [<Struct>] attribute as in the answer referenced by A-Dubb. type ReturnCode = int [<System.Runtime.InteropServices.DllImport("something.dll")>] extern ReturnCode GetParent(System.IntPtr inRef, System.IntPtr& outParentRef); To call the