Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass Vfp Object to a DCOM server ?
Message
 
 
To
11/08/2000 20:18:58
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00399459
Message ID:
00404261
Views:
13
>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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform