Autor Beitrag
covel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 131

Win XP PRo
Borland D7/C#
BeitragVerfasst: Di 06.06.06 07:11 
Moin,

haben nen kleines Problem. Folgender Code funktioniert unter Win Xp ohne Probleme unter Win 2K jedoch nicht.

ausblenden Delphi-Quelltext
1:
2:
if (ShellExecute(Application.Handle, 'open', PChar(copypath+presentation), Nil, Nil, SW_NORMAL) <= 32) then
    memo_log.Lines.Add('Die Päsentation konnte nicht gestartet werden.');


copypath = z.b. c:\programme\
presentation = z.b. show.ppt //Powerpoint

Was mache ich falsch?? Habe schon die Forensuche benutzt bin jedoch nicht fündig geworden.

Nachtrag: Habe mir die Fehlernr ausgeben lassen! Fehlernr. = 31

Grüße
Michael
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Di 06.06.06 08:59 
Statt Application.handle handle (=Form1.handle) oder einfach nil
Statt copypath+presentation auszuführen, versuch mal, copypath in den vorletzten Parameter zu verlegen (Pfad).

ausblenden Delphi-Quelltext
1:
ShellExecute(handle, PChar('open'), PChar(presentation), PChar(''), PChar(copypath), SW_SHOW)					

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Di 06.06.06 09:22 
Hi,
Bei mir (Win2K + D2005) funktioniert dein Code.
Also Fehlernr. 31 ist nicht spezifiziert -> unbekannter Fehler
Daher können alle spezifizerten Fehler ausgeschlossen werden.
Hast du die nötigen Systemvorraussetzungen (siehe Suche im MSDN MSDN.MICROSOFT.COM/L...ONS/SHELLEXECUTE.ASP) ?

Falls nichts hilft versuche es mit CreateProcess.
covel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 131

Win XP PRo
Borland D7/C#
BeitragVerfasst: Di 06.06.06 13:39 
Erstmal besten danke für eure hilfe,

habe aber das problem selber gelöst.

ausblenden Delphi-Quelltext
1:
2:
if (ShellExecute(form1.Handle, 'open',PChar(copypath+'pptview.exe'), PChar(presentation), Nil, SW_NORMAL) <= 32) then
    memo_log.Lines.Add('Die Päsentation konnte nicht gestartet werden.');


ich rufe den Powerpointviewer direkt mit den benötigten Parametern auf. Vorher habe ich immer die Präsentation direkt geöffnet.