Using records as property types in Delphi COM Wizard

1

I am trying to design a COM library that uses a property to return a record. The Delphi COM Wizard allows me to create the property, but when it is compiled, I get

[GENTLB Error] Project1.ridl(1): Error saving C:\Users\mark\Documents\RAD Studio\Projects\Test\Project1.tlb: Inconsistent property functions

The RIDL file that is generated looks like this ...

[
 uuid(24BD89DB-AB22-430C-874C-EC5CEA062E80)
]   
struct Record1   
{
    long Field1;   
};


[
  uuid(FA48C31A-56B8-4A86-8325-5A2000AA77B2),
  helpstring("Interface for XXX Object"),
  oleautomation
]
interface IXXX : IUnknown
{
  [propget, id(0x00000065)]
  HRESULT _stdcall Property1([out, retval] struct Record1* Value);
  [propput, id(0x00000065)]
  struct Record1 _stdcall Property1([in] long Value);
};

Can anyone see what I am doing wrong here?

delphi
typelib
asked on Stack Overflow Jun 27, 2010 by mmmm • edited Nov 25, 2014 by VividD

1 Answer

1

The "propput" part should look like this:

[propput, id(0x00000065)]
HRESULT _stdcall Property1([in] struct Record1 Value);
answered on Stack Overflow Jun 27, 2010 by Ondrej Kelle

User contributions licensed under CC BY-SA 3.0