Autor Beitrag
Björn karpenstein
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: So 02.10.05 16:23 
Hallo!

Ich habe die TDirectSS-Komponentente von der Microsoft Speech Engine auf mein Hauptformular gezogen (sprechender Mund). Starte ich das Programm auf einem Rechner, der die Engine nicht installiert hat, bekomme ich gleich am Anfang die Meldung, dass die Datei qtinf70.dll nicht gefunden werden kann.

An welcher Stelle fragt man das ab ob es installiert wurde und wie?

Mfg

Björn K
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: So 02.10.05 17:00 
Hallo,

bist Du sicher, dass diese Datei von der Speechengine benötigt wird ?. Ich habe sie installiert, konnte aber keine solche Datei finden.

Ich würde mal vermuten, dass diese Datei was mit Delphi zu tun hat..

Thomas
Björn karpenstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: So 02.10.05 17:05 
Hallo!

Ich denke ja, weil ich die Anwendung auf einem Rechner installieren wollte, und da hat er auch mit der qtinf70.dll gemeckert, nach der Installation von MSAgent, Speechengine und SpeechAPI hat es funktioniert. Aber ich suche noch eine Stelle, an der ich den Benutzer darauf hinweisen kann, dass es noch nicht installiert ist.

Habs mal hier probiert, aber der die Fehlermeldung kommt immer noch (ohne das SHowMessage):

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
  try
    begin
      Application.Initialize;
      Application.CreateForm(TDataModule1, DataModule1);
      Application.CreateForm(TFormular_Hauptfenster, Formular_Hauptfenster);
      Application.Run;
    end;
  except
    on E : Exception do ShowMessage(E.Message);
  end;
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: So 02.10.05 17:26 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  voice: OLEVariant;
begin
  voice := CreateOLEObject('SAPI.SpVoice');

  if voice=nil then showMessage('API vermutlich nicht installiert !!);

  voice:=nil;

end;


Damit solltest Du feststellen können, ob die Speech-API installiert ist. Ist eventuell nicht ganz sauber, aber was Bessseres fällt mir auf die Schnelle nicht ein.

Ich würde es mal vor dem ersten CreateForm einbauen.
Björn karpenstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: So 02.10.05 18:01 
Also habs mal so probiert, aber da sagt er das Pointer und OleVariant keine kombatiblen Typen sind:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var  
  voice: OLEVariant;
begin
  Application.Initialize;
  voice := CreateOLEObject('SAPI.SpVoice');
  if voice=nil then showMessage('API vermutlich nicht installiert !!');
  voice:=nil;
  Application.CreateForm(TDataModule1, DataModule1);
  Application.CreateForm(TFormular_Hauptfenster, Formular_Hauptfenster);
  Application.Run;
end.


Habs auch mal so probiert:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
unit dss;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComObj, ACTIVEVOICEPROJECTLib_TLB;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
    DirectSS1 : TDirectSS;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin
 try
 begin
  DirectSS1 := TDirectSS.Create(self);
  DirectSS1.Speak('bin da');
 end;
 except
   on E : Exception do ShowMessage(E.Message);
 end;
end;


end.


So kann man testen ob es zur Laufzeit existeiert - er öffnet das Form und geht in den Except-Block. Das könnte ich als Prüfprogramm davorbauen :D. Aber dann hätte ich 2 EXE-Dateien.
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: So 02.10.05 18:11 
Sorry, deklariere mal voice als IDispatch, dann sollte es keine Fehlermeldung mehr geben..

Für den Fall, das voice=nil ist, solltest Du mal Application.Terminate aufrufen, das sollte Deine Anwendung eigentlich sicher beenden...
Björn karpenstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: Mo 03.10.05 14:22 
Hmm also er meckert jetzt nicht mehr, allerdings kommt die Fehlermeldung immer noch.

Sogar wenn ich ein "ShowMessage('Hallo');" vor Application.Initialize schreibe kommt die Fehlermeldung. Mir kommt
es fast so vor als ob WIndows vor dem Start der EXE-Datei überprüft ob die DLL da ist. Was kann ich noch tun?
Björn karpenstein Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

Windows XP, Linux
D7, K3
BeitragVerfasst: Mo 03.10.05 16:00 
Verdammte Axt - ich hab ein Unit mit Q benutzt (QClipbrd anstelle von Clipbrd) :(

Du hattest Recht die qtinf70.dll hat nix damit zu tun. Mist war ich wohl verdammt auf dem Holzweg :D
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: Mo 03.10.05 16:02 
Hallo,

versuch mal diese Variante:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
var  
  voice: OLEVariant;
begin
  Application.Initialize;
  voice := CreateOLEObject('SAPI.SpVoice');
  if voice=nil then 
    begin
     showMessage('API vermutlich nicht installiert !!')
     Application.Terminate;
    end
  else begin
     voice:=nil;
     Application.CreateForm(TDataModule1, DataModule1);
     Application.CreateForm(TFormular_Hauptfenster, Formular_Hauptfenster);
     Application.Run;
  end;
end.
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: Mo 03.10.05 16:04 
O.K, dann setz das Topic bitte noch auf erledigt...-)

Thomas