Solved

Thaddy> SAPI

Posted on 1998-11-12
11
322 Views
Last Modified: 2010-04-04
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.
0
Comment
Question by:jecksom
  • 6
  • 5
11 Comments
 
LVL 2

Expert Comment

by:Thaddy
ID: 1346668
If Olevariant(Vcommand).AddCommand(Acommand) works do I get the points?

0
 
LVL 1

Author Comment

by:jecksom
ID: 1346669
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

0
 
LVL 1

Author Comment

by:jecksom
ID: 1346670
PS:    Vcommand1: TVcommand; from Microsoft Voice Command OCX.

0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1346671
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.
0
 
LVL 1

Author Comment

by:jecksom
ID: 1346672
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


0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 2

Expert Comment

by:Thaddy
ID: 1346673
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)

0
 
LVL 1

Author Comment

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


0
 
LVL 2

Expert Comment

by:Thaddy
ID: 1346675
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.
0
 
LVL 1

Author Comment

by:jecksom
ID: 1346676
Yes ! example would be great !
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 100 total points
ID: 1346677
Check this out: All that was wrong in your code are a few little quirks:
'First: make shure not to pass a const empty widestring without 'an extra #00
'MAKE SHURE that you pass a parameter to a valid Twincontrol, 'like Mainmenu1.
procedure TForm1.FormCreate(Sender: TObject);
begin
Vcommand1.Initialized := 1;
Vcommand1.Enabled:= 1;
gMymenu := Vcommand1.MenuCreate['Mainmenu1', 'state1', 4];
Vcommand1.AddCommand(gMymenu, 1, 'red', 'when you say' + 'red', 'listen list', 0, ''#00);
Vcommand1.AddCommand(gMymenu, 1, 'blue', 'when you say' + 'blue', 'listen list', 0, ''#00);
Vcommand1.AddCommand(gMymenu, 1, 'green', 'when you say' + 'green', 'listen list', 0, ''#00);

UpdateList;
Vcommand1.Activate(gMymenu);
end;

0
 
LVL 1

Author Comment

by:jecksom
ID: 1346678
Yep ! It works ! thanx for your help !

Jecksom.

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now