Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi importierte COM TLB lässt sich nicht compilieren. (https://www.delphipraxis.net/99988-importierte-com-tlb-laesst-sich-nicht-compilieren.html)

stoxx 24. Sep 2007 11:53

Re: importierte COM TLB lässt sich nicht compilieren.
 
Zitat:

Zitat von negaH
Eine Variante kann in Delphi, wenn ich nicht falsch liege, keine Records aufnehmen.

Gruß Hagen

Hallo Hagen,


Es scheint doch zu gehen, ein Freund von mir hat es so gelöst...


Delphi-Quellcode:
function VariantZuRecord(const V: OleVariant): CQGCELConfiguration;
var P : Pointer;
begin
 P := VarArrayLock(V);
try
  Move(P^, Result, SizeOf(Result));
finally
  VarArrayUnlock(V);
end;
end;

function RecordZuVariant(const Rec: CQGCELConfiguration): OleVariant;
var
 P : Pointer;
begin
  Result := VarArrayCreate([0, SizeOf(Rec) - 1], varByte);
  P := VarArrayLock(Result);
try
  Move(Rec, P^, SizeOf(Rec));
finally
  VarArrayUnlock(Result);
end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:28 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz