You need....

1
2
3
4
5
6
let p = new Point(1,1)


let x = p.ToInt32()  // <- empty parameter list

I don't know how you got that particular error. When I entered the F#

code into the editor intellisense picked up the error and prompted with

correct signature.

It's all working nicely in my VS 2010. I've done some C#/F# interoperability in VS 2008 with

the 1.9.6.16 and found it worked also.

When you've got that going, you might like try this, just to see it all hanging together...

1
2
3
4
5
        public static int ToInt32(this Point point)
        {
            return point.X;
        }
       

F#...

1
2
3
let mutable p = new System.Drawing.Point(1,1)
p.X <- 100
System.Console.WriteLine(sprintf "x is %i" (p.ToInt32()))
By on 6/12/2009 10:43 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper