Link to home
Start Free TrialLog in
Avatar of jecksom
jecksom

asked on

Thaddy> SAPI

Hello !

Can you show me delphi source of Tvcommand from SAPI 4,
i always get error on "Vcommand1.AddCommand(" :( ,
or maybe anyone known solution also.

Jecksom.
Avatar of Thaddy
Thaddy

If Olevariant(Vcommand).AddCommand(Acommand) works do I get the points?

Avatar of jecksom

ASKER

I'll better show my source :

var
  gmymenu:longint;

procedure TForm1.FormCreate(Sender: TObject);
begin
Vcommand1.Initialized := 1;
gMymenu := Vcommand1.MenuCreate['Project1', 'state1', 4];
Vcommand1.Enabled := 1;
Vcommand1.AddCommand(gMymenu, 1, 'red', 'when you say' + 'red', 'listen list',0, '');///ERROR
Vcommand1.AddCommand(gMymenu, 1, 'blue', 'when you say' + 'blue', 'listen list', 0, '');
Vcommand1.AddCommand(gMymenu, 1, 'green', 'when you say' + 'green', 'listen list', 0, '');
Vcommand1.Activate(gMymenu);
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
Vcommand1.ReleaseMenu(gMymenu);
end;

I've just transfered it from VB source . "///ERROR" - Access Violation .... Xcommand.dll,
maybe you know why ? or maybe i'm doing wrong way ?

Jecksom

Avatar of jecksom

ASKER

PS:    Vcommand1: TVcommand; from Microsoft Voice Command OCX.

I'll check it this weekend. will be back.
Until then, why not try the ms agent stuff? MS states this will be their (high level) standard for text to speech and speech to text. You don't have to show some not.so.funny characters, they are just part of the spec. the speech engine is, apart from the dragon products, the best I've seen jet.
Avatar of jecksom

ASKER

HI , Dragon dictant ? i didn't checked it myslef , does it based on MS API ? or  they have
self designed  engine ?
Okay , i'll try MS agent , hope you'll don't forget about my question after weekend .

Best Regards,
           Jecksom


Olevariant(Vcommand1).AddCommand(gMymenu, 1, 'red', 'when you say' + 'red', 'listen list',0);///NO ERROR , you default to the default!
As explained in first comment, this works (and I tested it too)

Avatar of jecksom

ASKER

Olevariant(Vcommand1).AddCommand(gMymenu, 1, 'red', 'when you say' + 'red', 'listen list',0); ----> Invalid Typecast at : "Olevariant(Vcommand1).". How i can fix that ?


Oops, forgot to say that I did use it directly, that is, not with an ocx wrapper but directly via the interface.
I create the control almost always via a coXX.Create
look in the *_TLB.PAS file and look for the coClasses section
There you'll find the interfaces that you can create an instance of directly. Then, use them as needed. If you need help, I'll send an example.
Avatar of jecksom

ASKER

Yes ! example would be great !
ASKER CERTIFIED SOLUTION
Avatar of Thaddy
Thaddy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jecksom

ASKER

Yep ! It works ! thanx for your help !

Jecksom.