AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Set hostname - can't write to registry

Ein Thema von WojTec · begonnen am 5. Apr 2012 · letzter Beitrag vom 7. Apr 2012
 
Benutzerbild von jaenicke
jaenicke

Registriert seit: 10. Jun 2003
Ort: Berlin
9.963 Beiträge
 
Delphi 12 Athens
 
#9

AW: Set hostname - can't write to registry

  Alt 6. Apr 2012, 16:37
You have to ensure, that no other API function is called after the one you want to check against errors. Otherwise the error state is overwritten before you check it...
But here you call ShowMessage for the result of SetComputerName and fetch the error after this. So you won't get an error unless ShowMessage fails...
What about this way?
Delphi-Quellcode:
if SetComputerName('TTX') then
  ShowMessage('Success')
else
  ShowMessage(SysErrorMessage(GetLastError));
Sebastian Jänicke
AppCentral
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:37 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz