On May 27, 2004, at 3:14 PM, Ruslan Zasukhin wrote:
On 5/27/04 11:52 PM, "Jonathan Johnson" <jonj at realsoftware dot com> wrote:
Interfaces do not have properties.
Yes, as workaround I can try to use that trick with Assigns word.
Oops, replied before reading everything (sorry). So, you're saying
that
you don't have to implement the two methods you define in COM?
Interface I_Link
{
BSTR get_Name();
void put_Name( BSTR inName );
};
Those methods aren't implemented anywhere? If they are, then how is it
a "trick" with the assigns keyword?
Hi Jonathan,
They are implemented of course. Right.
1) I talk now about small problem as I see -- refactoring of existed
CLASS.
Right now I have the old EXISTED class VTable.
REALproperty TableProperties[] = {
{ NULL, "Name", "String", 0, (REALproc)
Table_GetName,
(REALproc) Table_SetName },
{ NULL, "FieldCount", "Integer", 0, (REALproc)
Table_GetFieldCount },
{ NULL, "RecordCount", "Integer", 0, (REALproc)
Table_GetRecordCount },
{ NULL, "DataBase", "VDataBase", 0, (REALproc)
Table_GetDataBase },
{ NULL, "Encrypted", "Boolean", 0, (REALproc)
Table_GetIsEncrypted, NULL },
{ NULL, "PhysicalRecordCount", "Integer", 0, (REALproc)
Table_GetPhysicalRecordCount },
};
I want create I_Table interface, and make Vtable class implementing it.
As far as I understand, in Interface I will need 2 __methods__
For each property
{ REALnoImplementation, REALnoImplementation,
"Name() as String"},
{ REALnoImplementation, REALnoImplementation,
"Name( Assigns inName as String )” },
But now, if I inherit from interface, I must implement in the Vtable
class
exactly the same methods, right?
Then they will conflict to EXISTED properties.
Change the name of the existing property to something private.
Then Name() and Name(assigns s as string) manipulate that private
member in VTable
And nothing else knows or cares as long as they continue to use Name as
though it were a property.
I've done this. In both RB code and plugins.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|