Use a curried function:

recoContext.add_Hypothesis(fun j o r -> () );

or make it even more explicit:

recoContext.add_Hypothesis(new _ISpeechRecoContextEvents_HypothesisEventHandler(fun j o r -> ()));

See also

[link:research.microsoft.com]

Cheers!

don

By on 3/26/2007 3:11 PM ()

I meant to add - I'm looking forward to seeing (or talking to) your sample when you're done! I've been meaning to play with the Speech API for a long time :-)

Don

By on 3/26/2007 4:16 PM ()

Don,

I truly appreciate all the help you have provided so far. Another issue on the same subject. I made the changes as per your suggestions. At this point, the code compiles fine.

#light

let recoContext = new SpeechLib.SpSharedRecoContextClass();;

let hypothesis_handler = new _ISpeechRecoContextEvents_HypothesisEventHandler(fun j o r -> ())

recoContext.add_Hypothesis(hypothesis_handler);;

When the code is run, I get the following error message.

Method not found: 'Void SpeechLib._ISpeechRecoContextEvents_HypothesisEventHandler..ctor(System.Object, IntPtr)'. I could not find anything in the SAPI documentation that helped.

Again, thanks and regards

Chris

By on 3/26/2007 6:37 PM ()

Just to confirm this is fixed in F# 1.9.1.8. Please give it another go and let us know if there are any more problems.

Thanks!

don

By on 4/9/2007 1:46 PM ()

Hi Chris,

This one is a bug or incompleteness in F# - this occasionally happens when people access a new library, and inthis case will be related to the auto-generated COM wrappers having some unusual form. I'll look into it later today when I can download the speech SDK. We should have a fix in for the next version of F# which we'r finalizing now, unless there is a simple workaround.

Don

By on 3/27/2007 1:55 AM ()

OK, I see the problem - for some reason the generated APIs to access COM components use different non-standard signatures for their delegate constructors (very annoying). We'll get a fix into the next release.

Thanks

don

By on 3/27/2007 10:40 AM ()
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