>You can't use AddProperty with COM. The reason I believe is because the type library and interface are defined when you build the DLL (see VTABLE, early & late binding, don't want to get into that unless I have to). Conversely, in your scenario, the properties that you added don't seem to be included in the COM representation of your object when you pass it over DCOM as properties added with AddProperty do not seem to be recognized as part of the object's interface.
>
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.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao