Thema: Delphi Geolocation Windows API

Einzelnen Beitrag anzeigen

TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.060 Beiträge
 
Delphi 10.4 Sydney
 
#19

AW: Geolocation Windows API

  Alt 26. Aug 2022, 10:57
Zitat:
IID = (4082257043, 58823, 23432, (190, 219, 211, 230, 55, 207, 242, 113)) gefragt, was als bekannte Hex(-String)
Wie kommst du von diesem Wert zu diesem Hex(-String)? Was wäre hier die einfachste Möglichkeit?
Kopfrechnen?

Nur Spaß, mit ein-zwei Zeilen bist du dabei (siehe auch vorige Antworten):

Delphi-Quellcode:
program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

var
    IID: TGUID;

begin
  try
    IID := TGUID.Create(4082257043, 58823, 23432, 190, 219, 211, 230, 55, 207, 242, 113);
    Writeln(IID.ToString)
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
  Readln;
end.

Das verwendet dann den TGUIDHelper aus System.SysUtils (nein, ich weiß nicht seit wann das drin ist, bitte fragt nicht):
Delphi-Quellcode:
class function TGUIDHelper.Create(A: Cardinal; B, C: Word; D, E, F, G, H, I, J, K: Byte): TGUID;
begin
  Result.D1 := UInt32(A);
  Result.D2 := Word(B);
  Result.D3 := Word(C);
  Result.D4[0] := D;
  Result.D4[1] := E;
  Result.D4[2] := F;
  Result.D4[3] := G;
  Result.D4[4] := H;
  Result.D4[5] := I;
  Result.D4[6] := J;
  Result.D4[7] := K;
end;
  Mit Zitat antworten Zitat