Einzelnen Beitrag anzeigen

Benutzerbild von Sprint
Sprint

Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
 
Delphi 5 Professional
 
#6

Re: Typecast ohne Typ zu kennen?

  Alt 24. Mai 2005, 11:07
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
const
  S_CAPTION = 'Caption';
var
  Count: Integer;
  PropList: PPropList;
  I: Integer;
begin

  Count := GetPropList(Sender, PropList);
  if Count > 0 then
  begin
    for I := 0 to Count - 1 do
      if PropList[I].Name = S_CAPTION then
        if PropList[I].PropType^.Kind = tkLString then
        begin
          SetStrProp(Sender, S_CAPTION, 'Hello World!');
          Break;
        end;
    FreeMem(PropList);
  end;

end;
Ciao, Sprint.

"I don't know what I am doing, but I am sure I am having fun!"
  Mit Zitat antworten Zitat