Autor Beitrag
hybris42
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 17



BeitragVerfasst: Mo 02.07.07 15:23 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(Handle, 'ipconfig /renew'nilnil, SW_SHOWNORMAL);
end;


ausblenden Delphi-Quelltext
1:
[Fehler] botyass.pas(35): E2010 Inkompatible Typen: 'Integer' und 'PAnsiChar'					


hey,
bei diesem befehl komm ich nicht weiter, bitte um Hilfe.
gruß


Moderiert von user profile iconChristian S.: Topic aus VCL (Visual Component Library) verschoben am Mo 02.07.2007 um 18:38
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Mo 02.07.07 15:25 
Nimm statt nil nen leeren String.

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



BeitragVerfasst: Mo 02.07.07 15:31 
user profile iconTimosch hat folgendes geschrieben:
Nimm statt nil nen leeren String.


so etwas:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(Handle, 'ipconfig /renew', SW_SHOWNORMAL);
end;


fehler ist identisch mit post#1
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 02.07.07 15:45 
Shellexecute ist folgendermaßen aufgebaut

ausblenden Quelltext
1:
Handle, pchar(Operation), pchar(Dateiname), pchar(Parameter), pchar(Verzeichnis), Cardinal(showCommand);					


ausblenden Delphi-Quelltext
1:
shellExecute(handle, pchar('command'), pchar('ipconfig /renew'), nil, pchar(''), sw_ShowNormal);					


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Mo 02.07.07 16:03 
den PCHar Typecast kannst du dir sparen... leere Strings machen da auch wenig sinn^^ nil is schon richtig ;)

der einzige fehler war, dass die Parameter nicht gepasst haben ;)

gruss

_________________
erare humanum est
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 02.07.07 16:07 
Super Programmiereinstellung!

Wenn die Funktion diesen Typ verlangt, bekommt sie ihn..ganz einfach!

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Mo 02.07.07 16:13 
user profile iconZeitGeist87 hat folgendes geschrieben:
Super Programmiereinstellung!

Wenn die Funktion diesen Typ verlangt, bekommt sie ihn..ganz einfach!

LG
Stefan


Den bekommt sie auch so. Es geht auch nicht um eine "Super Programmiereinstellung" sondern darum, wie delphi mit Strings umgeht, wenn man das weis, weis man auch, dass ich recht habe :P

gruss

_________________
erare humanum est
hybris42 Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 17



BeitragVerfasst: Mo 02.07.07 16:14 
user profile iconZeitGeist87 hat folgendes geschrieben:
Shellexecute ist folgendermaßen aufgebaut

ausblenden Quelltext
1:
Handle, pchar(Operation), pchar(Dateiname), pchar(Parameter), pchar(Verzeichnis), Cardinal(showCommand);					


ausblenden Delphi-Quelltext
1:
shellExecute(handle, pchar('command'), pchar('ipconfig /renew'), nil, pchar(''), sw_ShowNormal);					


LG
Stefan


hey, danke für die hilfe, es klappt, zumindest kommt keine fehlermeldung mehr
ABER
mit ipconfig / renew soll ja meine ip geändert werden, was leider nicht stattfindet. wie muss ich den befehl (für dos) gestalten?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10184
Erhaltene Danke: 1259

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 02.07.07 16:19 
Moin und :welcome: im Forum!

user profile iconhybris42 hat folgendes geschrieben:
mit ipconfig / renew soll ja meine ip geändert werden, was leider nicht stattfindet. wie muss ich den befehl (für dos) gestalten?

Grundsätzlich: Neue Frage - neuer Thread! :mahn: Sonst gibt das hier Chaos. ;)

Aber trotzdem kurz zu deiner Frage: wer hat denn sowas erzählt?! :shock: Das ist (grundsätzlich erstmal) falsch! Damit aktualisierst du deine vom DHCP-Server bezogenen Daten, sonst nix. :idea:

Bitte beachten: wenn du noch Fragen zu ipconfig hast, dann in einem neuen Thread (IMHO ist das OT)!

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 02.07.07 16:21 
Du musst ihm erst mit

ausblenden Quelltext
1:
ipconfig /release					


sagen, dass er seine bisherigen Einstellungen vergessen soll.

Dann wendest du deinen Parameter an.
Somit fordert er neue Einstellungen vom DHCP-Server an.

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
hybris42 Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 17



BeitragVerfasst: Mo 02.07.07 16:23 
user profile iconZeitGeist87 hat folgendes geschrieben:
Du musst ihm erst mit

ausblenden Quelltext
1:
ipconfig /release					


sagen, dass er seine bisherigen Einstellungen vergessen soll.

Dann wendest du deinen Parameter an.
Somit fordert er neue Einstellungen vom DHCP-Server an.

LG
Stefan


Super! Vielen vielen dank Stefan, dass ging ja mal blitzschnell. :) :)
werds gleich testen :)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10184
Erhaltene Danke: 1259

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 02.07.07 16:26 
Moin!

Das wird hier immer mehr OT... :|

user profile iconZeitGeist87 hat folgendes geschrieben:
Du musst ihm erst mit
ausblenden Quelltext
1:
ipconfig /release					

sagen, dass er seine bisherigen Einstellungen vergessen soll.

Das tut /renew auch so. ;)

Nochmal: das gewünschte Ergebnis ("neue IP") muss damit nicht zwangsweise erreicht werden, das hängt von der Konfiguration des DHCP-Servers ab! Und zur Sicherheit noch obendrauf: die "Internet-IP" kann man damit sowieso nicht ändern. :mahn:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
hybris42 Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 17



BeitragVerfasst: Mo 02.07.07 16:47 
user profile iconNarses hat folgendes geschrieben:
Moin!

Das wird hier immer mehr OT... :|

user profile iconZeitGeist87 hat folgendes geschrieben:
Du musst ihm erst mit
ausblenden Quelltext
1:
ipconfig /release					

sagen, dass er seine bisherigen Einstellungen vergessen soll.

Das tut /renew auch so. ;)

Nochmal: das gewünschte Ergebnis ("neue IP") muss damit nicht zwangsweise erreicht werden, das hängt von der Konfiguration des DHCP-Servers ab! Und zur Sicherheit noch obendrauf: die "Internet-IP" kann man damit sowieso nicht ändern. :mahn:

cu
Narses


werde neuen thread erstellen thx nochmal an alle :)

edit: hier gehts weiter

Moderiert von user profile iconChristian S.: Daher hier geschlossen
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.