I am trying to translate the F # code from this article http://www.codeproject.com/Articles/35532/C-COM-Object-for-Use-In-JavaScript-HTML-Including
I came across the following lines:
public delegate void MyFirstEventHandler(string args); public event MyFirstEventHandler MyFirstEvent;
I tried translating this to F # as:
type MyFirstEventHandler = delegate of string -> unit type MyFsComComponent () = let my_event = new Event<MyFirstEventHandler,string> () [<CLIEvent>] member x.MyFirstEvent = my_event.Publish
And I get: "MyFirstEventHandler" has a non-standard delegate
I can compile with:
type MyFirstEventHandler = delegate of obj*string -> unit
But this is not what COM management needs.
This issue was also raised in the C # section for class F # transition - the "public event" still had no solution.
solvable. Thanks Leaf Garland
type MyFirstEventHandler = delegate of string -> unit type MyFsComComponent () = let my_event = new DelegateEvent<MyFirstEventHandler> () [<CLIEvent>] member x.MyFirstEvent = my_event.Publish
does the trick.
Ingaz source share