Solved

Thaddy> SAPI

Posted on 1998-11-12
11
327 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 73
Magic Software info 18 142
Why can't I create any project with my delphi EXE file? 6 45
Adoquery sql  left join does not work 25 104
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 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