Hi All,
I would like to understand the following situation, so please bear with me...
Object B which is an intance of Class cB, Interface iB which is inhereted from Interface iA, Class cA. Now my question is Object b should have an interface which is supported by iA? Why is it not working as I expect?
Here is a sample: (I expect STR$(ISINTERFACE(b, iA)) to return true... [
])
I would like to understand the following situation, so please bear with me...
Object B which is an intance of Class cB, Interface iB which is inhereted from Interface iA, Class cA. Now my question is Object b should have an interface which is supported by iA? Why is it not working as I expect?
Here is a sample: (I expect STR$(ISINTERFACE(b, iA)) to return true... [

Code:
#COMPILE EXE #DIM ALL CLASS cA INSTANCE sStr AS STRING INTERFACE iA INHERIT IUNKNOWN PROPERTY GET Desc() AS STRING PROPERTY = sStr END PROPERTY PROPERTY SET Desc(BYVAL sInStr AS STRING) sStr = sInStr END PROPERTY END INTERFACE END CLASS CLASS cB INSTANCE sStrB AS STRING INTERFACE iB INHERIT cA, iA PROPERTY GET DescB() AS STRING PROPERTY = sStrB END PROPERTY PROPERTY SET DescB(BYVAL sInStr AS STRING) sStrB = sInStr END PROPERTY END INTERFACE END CLASS FUNCTION PBMAIN () AS LONG LOCAL a AS iA LOCAL b AS iB B = CLASS "cB" b.Desc = "TEST" b.DescB = "TESTB" MSGBOX b.Desc + " " + b.DescB MSGBOX STR$(ISINTERFACE(b, iA)) a = b MSGBOX STR$(OBJPTR(a)) END FUNCTION
Comment