Autor Beitrag
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 06.05.05 16:13 
bis jetzt hab ich immer mit folgendem code .exe's gestartet, un das ging auch eigentlich ganz gut:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
strpcopy ( command,trim('D:\Games\Warcraft III(old)\w3l.exe'));
fillchar(startupinfo,sizeof(startupinfo),#0);
startupInfo.wShowWindow:=SW_SHOWNORMAL;
startupinfo.cb:=sizeof(startupinfo);
startupinfo.dwFlags:= STARTF_USESHOWWINDOW;
Success:=CreateProcess(nil,
      command,
      nil,
      nil,
      false,
      CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
      nil,
      nil,
      Startupinfo,
      Processinfo);


Doch nun hab ich nen prob:
für Warcraft 3 (was ich da gerade starten will) brauch ich einen extra loader, der heißt "w3l.exe" un muss sich im Warcraft III ordner befinden.
Wenn ich einfach so doppelt auf w3l.exe draufklicke geht es, aber aus meinem programm heraus gibt mir w3l.exe einen Fehler der besagt, das es nicht im richtigen Verzeichnis(Warcraft III ordner) ist un benötigte dateien nicht findet.

Kann das sein das durch den code das w3l.exe dort ausgeführt wird wo mein delphi programm ist?
und wie kann ich einfach nur eine .exe sozusagen "virtuell doppelklicken"?
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Fr 06.05.05 16:16 
mach mal vorher SetCurrentDirectory(<wc3pathhier>)

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

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 06.05.05 16:53 
danke erstmal für die schnelle Hilfe, aber ich bekomm beim compile nen error:

ausblenden Delphi-Quelltext
1:
SetCurrentDirectory(w3tft);					


Zitat:
E2010 Incompatible types: 'string' and 'PAnsiChar'

wie kann ich meinen String in "PAnsiChar" oder was der auch immer verlangt umwandeln?

Moderiert von user profile iconTino: Delphi- & Quote-Tags hinzugefügt.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 06.05.05 17:22 
Kurz und knapp, einfach so: PChar(meinstring)

_________________
We are, we were and will not be.
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 06.05.05 18:06 
ok, danke euch beiden!
Schattengeist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Fr 03.06.05 12:17 
Moin!
Das kann ich so nicht stehen lassen ... :)
Also: Das dritte von unten (Zeile 13), ist 'lpCurrentDirectory'. Hier wird das Inizilisation-Verzeichnis angegeben.
Benutze das, und du musste nicht im Programm das Verzeichnis wechseln.
MFG SchattenGeist