Autor Beitrag
max120b
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

WinXP, Linux 9.0
Delphi 2005 Professional
BeitragVerfasst: Do 04.12.03 14:20 
Hi.
Ich hab zu Hause einem Mediaplayer geschrieben und wollt auch eine Encode-Funktion integrien. Ich hab mir dann den Lame Encoder aus dem Netz gezogen, und wolle ihn mit dem Befehl:

ausblenden Delphi-Quelltext
1:
2:
ShellExecute(Application.Handle, 'open', SysUtils.GetEnvironmentVariable('COMSPEC'),
PChar('/C dir c:\lame.exe (input-stream) (output-stream)'), nil, SW_ShowNormal);

aufrufen. funktionierte aber nicht. Delphi brach den debugg-Vorgang ab und gab aus, dass Inkompatible Typen string und PChar existieren. Kann mir vielleicht jemand sagen wieso?

Danke, Max :)

Moderiert von user profile iconKlabautermann: Delphi-Tags hinzugefügt.
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Do 04.12.03 18:25 
Hallo

Wenn du mit der Maus über ShellExecute fährst, zeigt Delphi dir die erwarteten Funktionsparameter an.
Daran kann man dann auch erkennen, dass als dritter Wert eine Variable vom Typ PChar verlangt wird.
GetEnvironmentVariable liefert allerdings eine Variable vom Typ String.

ausblenden Delphi-Quelltext
1:
2:
ShellExecute(Application.Handle, 'open', PChar(SysUtils.GetEnvironmentVariable('COMSPEC')),
PChar('/C dir c:\lame.exe (input-stream) (output-stream)'), nil, SW_ShowNormal);

_________________
If accidentally read, induce vomitting.
max120b Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

WinXP, Linux 9.0
Delphi 2005 Professional
BeitragVerfasst: Do 11.12.03 13:53 
Cool, danke für die Antwort. :) Max