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#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try something like the code below. I don’t know what
ReturnCodeis, 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.To call the function, you’d write something like this:
BTW: Could you also post a sample C code that implements the function in
something.dll? If yes, we could try running the solution before sending an answer…