Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 23.03.09 18:08 
Hallo,

seit dem Umstieg von D7 auf D2009 gibts einige Probleme, die anscheinend damit zusammenhängen, dass (ver)alte(te) Befehle nicht mehr korrekt funktionieren.

Ich habe o.g. Problem mit folgendem Code versucht zu lösen:
swissdelphicenter.ch/de/showcode.php?id=77

Das hat auch immer geklappt. Aber seit dem Umstieg auf D2009 meckert der Compiler herum
Zitat:

//winexec(pchar('rundll32.exe shell32.dll,'+'Control_RunDLL '+Filename),sw_shownormal);
[DCC Fehler] Unit1.pas(1307): E2010 Inkompatible Typen: 'Char' und 'AnsiChar'


Da habe ich einfach mal PChar zu PAnsiChar gemacht, dann führt er aus, aber der Code geht trotzdem nicht.
Auch ein Umstellen von WinExec auf ShellExecute hat nichts gebracht.

Könnte es auch sein, dass das daran liegt, dass ich Vista nutze ?

Ciao LHUser
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Mo 23.03.09 19:29 
WinExec verwendet man nicht mehr. Punkt. Das ist schon seit langem deprecated. Nimm ShellExecute.

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



BeitragVerfasst: Mo 23.03.09 20:21 
user profile iconLonghornUser hat folgendes geschrieben Zum zitierten Posting springen:
Auch ein Umstellen von WinExec auf ShellExecute hat nichts gebracht.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 23.03.09 20:30 
Ich habe gerade bemerkt, dass es auch ausreicht, einfach per Shellexecute die CPLs aufzurufen.

Nur bin ich mir da unsicher, ob das auch wirklich immer funktioniert (unter allen Windows-Versionen ab 98SE).
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Mo 23.03.09 21:27 
user profile iconLonghornUser hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconLonghornUser hat folgendes geschrieben Zum zitierten Posting springen:
Auch ein Umstellen von WinExec auf ShellExecute hat nichts gebracht.

Ähm, das hab ich natürlich gesehen! :mrgreen: Ich wollte obengenanntes bloß noch einmal betonen. :oops:
Also meiner Erfahrung nach funktionierts tatsächlich einfach so. Empirische Daten dazu hab ich aber keine.

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



BeitragVerfasst: Di 24.03.09 12:00 
Nagut, ich werde mal etwas herumtesten.

Seltsam ist nur: Wenn ich denselben Befehl, den ich mit Shellexecute aufrufen würde, in die Konsole eingebe und ausführe, klappt es. Beim Shellexecute passiert hingegen nichts ???
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Di 24.03.09 13:55 
Ähm, nur mal so aus Interesse: Du hast bei ShellExecute die Parameter schon in den dafür vorgesehenen (dritten?) Parameter gepackt statt die gesamte Kommandozeile in den zweiten Parameter, oder?

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



BeitragVerfasst: Di 24.03.09 17:46 
Öhm ... :oops: Das könnte ein Problem sein, ja :lol:
Ich schau mal nach.