Autor Beitrag
kongreddgrass
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 238

Win 98, Win 2000, Win Xp Prof.,Linux 8.2 Prof
Delphi 6
BeitragVerfasst: Di 26.08.03 20:32 
Hi

ich habe in einem zweiten Form für ShellExecute die uses schon eingebunden. Also keine Fehlermeldung. Nur verwende ich ShellExecute zweimal. Also kurz gesagt: 1 Programm wird gestartet, 2 Programm wird nicht gestartet, als ob kein OnClick-Ereignis hingemacht worden ist. :x
Hier mal der Code:
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:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, ShellApi;

type
  TForm2 = class(TForm)
    MainMenu1: TMainMenu;
    Programm1: TMenuItem;
    N10: TMenuItem;
    N11: TMenuItem;
    procedure N11Click(Sender: TObject);
    procedure N10Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.N11Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open''D:\Audiograbber\audiograbber.exe'nilnil, SW_SHOW);
end;

procedure TForm2.N10Click(Sender: TObject);
begin
ShellExecute(Application.Handle, 'open''D:\Borland\Delphi6\Bin\delpi32.exe'nilnil, SW_SHOW);
end;

end.

Woran liegt das Problem? Schaut alles richtig aus, nur..... :(
Mike

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.

_________________
o.o
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Di 26.08.03 21:11 
... nur?

Wenn ich von MathiasSimmack richtig gelernt habe, muß es

ausblenden Delphi-Quelltext
1:
PChar(Pfadangabe)					


heißen. Wenn ich nicht richtig gelernt habe, kriege ich jetzt sicher Haue. :mrgreen:

_________________
Hasta La Victoria Siempre
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Di 26.08.03 21:21 
ganz einfach ein Rechtschreibfehler!
ShellExecute(Application.Handle, 'open', 'D:\Borland\Delphi6\Bin\delpi32.exe', nil, nil, SW_SHOW);

oje oje oje

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
kongreddgrass Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 238

Win 98, Win 2000, Win Xp Prof.,Linux 8.2 Prof
Delphi 6
BeitragVerfasst: Di 26.08.03 21:44 
Oje oje oje oje
tschuldigung, hab nicht darauf aufgepasst.
:twisted::twisted::twisted:
Danke
Mike

_________________
o.o
Brueggendiek
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 304

Win 98, Win98SE, Win XP Home
D5 Std
BeitragVerfasst: Di 26.08.03 23:02 
Hallo!

@Terra23: PChar ist nur bei Variablen oder Ausdrücken nötig, bei Literalen (im Programmtext stehende Zeichenfolgen wie im Problemfall) regelt Delphi das von alleine!

Gruß

Dietmar Brüggendiek
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Di 26.08.03 23:50 
:oops:

Das wußte ich nicht. Aber was ist eine Literale?

_________________
Hasta La Victoria Siempre
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 27.08.03 00:58 
Eine Zeichenfolge.
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 27.08.03 08:37 
Mit anderen Worten:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
ShellExecute(self.Handle,
  'open',
  'c:\...\delphi32.exe',   // <-- gut!
  { ... }

aber
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
szFilename := 'c:\...\delphi32.exe'// Stringvariable

ShellExecute(self.Handle,
  'open',
  szFilename,  // <-- Compilerfehler
  { ... }
);

ShellExecute(self.Handle,
  'open',
  pchar(szFilename); // <-- wieder gut! :)
  { ...}

:)
kongreddgrass Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 238

Win 98, Win 2000, Win Xp Prof.,Linux 8.2 Prof
Delphi 6
BeitragVerfasst: Mi 27.08.03 11:05 
Danke für die Antworten.


Gruß Mike

_________________
o.o