Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

ID: 21674, Code Generated from type libraries incorrect for properties

by dean mitchell Email: Anonymous

Read-only property generates a read-only property. Write Only property generates a write-only property. Read-Write property generates a read-only property
Download Details
FTP  download also available 0 bytes
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For C++Builder, Version 5.0  to 5.0 3 downloads
Copyright: No significant restrictions

Size: 0 bytes
Updated on Sun, 02 May 2004 15:34:04 GMT
Originally uploaded on Thu, 29 Apr 2004 19:20:25 GMT
The problem is with the __property code that is generated from a type-libarry.

The get_ and _set methods are generated properly, but it is the code linking the property to these methods that is missing.

In the code below you can see that the only time a property makes use of the set_ method is if it is write-only.

Propety1 is a Write-Only property
Property2 is Read-Only property
Property3 is a Read-Write Property

HRESULT __fastcall set_Property1(BSTR Value/*[in]*/);

HRESULT __fastcall get_Property2(BSTR* Value/*[out,retval]*/);
BSTR __fastcall get_Property2(void);

HRESULT __fastcall get_Property3(BSTR* Value/*[out,retval]*/);
BSTR __fastcall get_Property3(void);
HRESULT __fastcall set_Property3(BSTR Value/*[in]*/);

__property BSTR Property1 = {write = set_Property1};
__property BSTR Property2 = {read = get_Property2};
__property BSTR Property3 = {read = get_Property3};

On further investigation it appears this only happens with properties of type BSTR

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03