Hi..
I have problem using class that use IMPLEMENTS. If i create a new class having interface from other class. The problem is I can't add a new public property or method in it. New property that i write didn't recognized by the instance object.
For example:
I have Interface Class called IHuman, have 3 Properties:
- Name
- DateBirth
- Sex
My Code for Interface Class IHuman:
Then I wrote another class called CEmploye that implements IHuman. Beside Name, DateBirth and Sex, i need new property named Salary.VB Code:
Public Property Get Name as string End Property Public Property Let Name(Byval sData as string) End Property Public Property Get DateBirth as Date End Property Public Property Let DateBirth(Byval dData as Date) End Property Public Property Get Sex as Integer End Property Public Property Let Sex(Byval iData as integer) End Property
My Code for Class CEmploye:
My Form's code:VB Code:
Implements IHuman Public Property Get Salary as double End Property Public Property Let Salary(Byval uData as double) End Property
Is there any solution(s) to add new method or property to this kind of class ?VB Code:
Private Sub Form_Load() Dim oEmp as IHuman Set oEmp as New CEmploye oEmp.Name = "Mike" oEmp.Sex=0 oEmp.Salary = 1000 '<--error here End Sub![]()
Best Regards,
- jude -




Reply With Quote