TTS SAPI with cf

  • Thread starter Thread starter Richard Henretta
  • Start date Start date
R

Richard Henretta

I am trying to build my first CE App, I am a windows / web developer
(So this compact framework is rather frustrating).

I started with the simplist task on this project. Text To Speak. I
can't figure out how to use a COM object with this framework though.

Can anyone give me a starting point? I've seen articles around, but
they all are doing it with embedded vc++. I would assume if it can be
done with c++ it can be done with .NET.

Any help would really be apprciated
 
Richard Henretta said:
I am trying to build my first CE App, I am a windows / web developer
(So this compact framework is rather frustrating).

I started with the simplist task on this project. Text To Speak. I
can't figure out how to use a COM object with this framework though.

Can anyone give me a starting point? I've seen articles around, but
they all are doing it with embedded vc++. I would assume if it can be
done with c++ it can be done with .NET.

Wrong. This is not true even for the full framework. The Compact Framework
is a subset of the full framework. There is quite a lot of things that you
cannot do with it including COM interop.
 
Alex Feinman said:
Wrong. This is not true even for the full framework. The Compact Framework
is a subset of the full framework. There is quite a lot of things that you
cannot do with it including COM interop.

Ok, comparing VC++ to C# was a little on the rash side. But it still
stands that accessing a COM object should not be difficult (Even on
cf). I have continued searching, and according to some articles, the
cf supports late binding. I can compile the code easy enough, but
when executed on the emulator, I get a MemberAccessException:

System.Type t = typeof(SpeechLib.SpVoice);
object voice = Activator.CreateInstance(t);
t.InvokeMember("Speak",BindingFlags.InvokeMethod,null,voice,new
object[] {"Yes! Yes! Yes!",0});

SpeechLib is a wrapper for the sapi.dll
 
You cannot create or call COM objects from the CF. There is no COM interop
support. You have to write a class factory wrapper and call into it. See
the POOM GDN sample:

http://www.opennetcf.org/samples.asp#POOM

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Richard Henretta said:
"Alex Feinman [MVP]" <[email protected]> wrote in message
Wrong. This is not true even for the full framework. The Compact Framework
is a subset of the full framework. There is quite a lot of things that you
cannot do with it including COM interop.

Ok, comparing VC++ to C# was a little on the rash side. But it still
stands that accessing a COM object should not be difficult (Even on
cf). I have continued searching, and according to some articles, the
cf supports late binding. I can compile the code easy enough, but
when executed on the emulator, I get a MemberAccessException:

System.Type t = typeof(SpeechLib.SpVoice);
object voice = Activator.CreateInstance(t);
t.InvokeMember("Speak",BindingFlags.InvokeMethod,null,voice,new
object[] {"Yes! Yes! Yes!",0});

SpeechLib is a wrapper for the sapi.dll
 
Or purchase CFCOM from Odyssey Software.

Paul T.

Chris Tacke said:
You cannot create or call COM objects from the CF. There is no COM interop
support. You have to write a class factory wrapper and call into it. See
the POOM GDN sample:

http://www.opennetcf.org/samples.asp#POOM

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Richard Henretta said:
"Alex Feinman [MVP]" <[email protected]> wrote in message
I am trying to build my first CE App, I am a windows / web developer
(So this compact framework is rather frustrating).

I started with the simplist task on this project. Text To Speak. I
can't figure out how to use a COM object with this framework though.

Can anyone give me a starting point? I've seen articles around, but
they all are doing it with embedded vc++. I would assume if it can be
done with c++ it can be done with .NET.

Wrong. This is not true even for the full framework. The Compact Framework
is a subset of the full framework. There is quite a lot of things that you
cannot do with it including COM interop.

Ok, comparing VC++ to C# was a little on the rash side. But it still
stands that accessing a COM object should not be difficult (Even on
cf). I have continued searching, and according to some articles, the
cf supports late binding. I can compile the code easy enough, but
when executed on the emulator, I get a MemberAccessException:

System.Type t = typeof(SpeechLib.SpVoice);
object voice = Activator.CreateInstance(t);
t.InvokeMember("Speak",BindingFlags.InvokeMethod,null,voice,new
object[] {"Yes! Yes! Yes!",0});

SpeechLib is a wrapper for the sapi.dll
 
Back
Top