That's a neat solution, but also requires get/set methods. I guess I should have been more specific with my answer: you can't access properties created with AddProperty directly via COM, you must provide an interface to them.
>Actually you can use AddProperty all you want. You just have to provide a means of accessing the new property across the COM barrier. Add the following two methods to your class:
>procedure GetProp
>lparameter tcPEM
>if pemstatus(THIS,tcPEM,5) and upper(pemstatus(THIS,tcPEM,3)) = "PROPERTY" then
> return eval("THIS."+tcPEM)
>else
> return .NULL.
>endif
>endproc
>
>procedure SetProp
>lparameter tcPEM, tuValue
>if pemstatus(THIS,tcPEM,5) and upper(pemstatus(THIS,tcPEM,3)) = "PROPERTY" then
> THIS.&tcPEM = tuValue
> return .T.
>else
> return .NULL.
>endif
>endproc
>The properties are there as part of the object but the interface is not published (neither via the VTable - early binding nor via IDispatch - late binding).
>
>The wrapper functions allow VFP to sort through its internal name table and get/set the property values.
Eric Shaneson
Cutting Edge Consulting