Thema: Delphi Was sind Structures

Einzelnen Beitrag anzeigen

Robert Marquardt
(Gast)

n/a Beiträge
 
#9

Re: Was sind Structures

  Alt 15. Apr 2007, 17:06
Ohne laestiges Alloziieren:
Delphi-Quellcode:
type
  LPGETTEXTEX = ^GETTEXTEX;
  GETTEXTEX = record
    cb: DWORD;
    flags: DWORD;
    codepage: UINT;
    lpDefaultChar: LPCSTR;
    lpUsedDefaultChar: LPBOOL;
 end;

// [...]

var
  tex: GETTEXTEX;
  pc: array [0..4095] of Char;
begin
  tex.cb := SizeOf(pc);
  tex.flags := GT_USECRLF;
  tex.codepage := CP_ACP;
  tex.lpDefaultChar := nil;
  tex.lpUsedDefaultChar := nil;
  SendMessage(controlHandle, EM_GETTEXTEX, WPARAM(@tex), LPARAM(@pc[0]));
  DoSomethingWithResult(pc);
end;
  Mit Zitat antworten Zitat