|I've encountered a probably setting a default property on a COM interface I am generating. This interface, IField, is generating dynamically from my application, and extends another of my interfaces, IMessageComponent (also generated dynamically, which inherits from IDispatch). I want to make the Value property (which is read/write) the default of the IField interface, so i've the the ID to zero.
When using it from VB6, it sometimes works. It always works if I am reading the value from the default property.
e.g. str = msg.Segment.Field This always works
However, when setting the value it does not work if there the object is set indirectly. For example:
Dim fld As Test.Field
fld = msg.Segment.Field
fld = "blah" This always works
msg.Segment.Field = "blah" This never works works - VB always gives a compile-time type mismatch error.
Has anyone encountered this previously and know of a workaround?