Property | IProperty Property calss | | --------------- | ComPropertyComProperty use property class as a template parameter.
template <class Tp> class ComProperty : public IProperty, private Tp { ...because exception can not come out of a COM method, so exceptions in property classes must be catched in ComProperty and transfered to error code.
virtual HRESULT STDMETHODCALLTYPE get_rho(value_type __RPC_FAR *val) { try { (*val) = Tp::get_rho(); } catch(PropertyNotImplement&) { return E_NOTIMPL; } catch(...) { return E_FAIL; } return S_OK; }then it is easy to get a COM property class from property class.
typedef ComProperty<water_steam<double> > com_water_steam;
allan xu, 2002-10-18