title: Iterate read-only properties in Delphi
body: <p>I'm trying to iterate through a COM object class to list all the properties, but readonly properties are not coming through. The class is defined with many properties but here are a couple ...</p>
  
  <pre><code>property RecLineSpacing: Integer dispid 123;
  property RecLinesToPaperCut: Integer readonly dispid 124;
  </code></pre>
  
  <p>The code I'm iterating with is ...</p>
  
  <pre><code>function PropertyValues(const AObject: TObject) : TStringlist;
  var
    PropIndex: Integer;
    PropCount: Integer;
    PropList: PPropList;
    PropInfo: PPropInfo;
  const
    TypeKinds: TTypeKinds = [tkUnknown, tkInteger, tkChar, tkEnumeration, tkFloat,
      tkString, tkSet, tkClass, tkMethod, tkWChar, tkLString, tkWString,
      tkVariant, tkArray, tkRecord, tkInterface, tkInt64, tkDynArray, tkUString,
      tkClassRef, tkPointer, tkProcedure];
  begin
    result:=tstringlist.Create;
    GetMem(PropList, SizeOf(PropList^));
    try
      PropCount := GetPropList(AObject.ClassInfo, TypeKinds, PropList);
      for PropIndex := 0 to PropCount - 1 do
      begin
        PropInfo := PropList^[PropIndex];
        result.Add ('['+propinfo.Name+']');
      end;
    finally
      FreeMem(PropList);
    end;
  end;
  </code></pre>
  
  <p>In this case the output lists RecLineSpacing but not RecLinesToPaperCut. Any idea why this would be?</p>
  
  <p>Thanks
  Terry</p>