Is the "ICapeThermoMaterialContext" useful?
Posted: 27 March 2014, 06:40
The "CO_Thermo_1.1_Specification_311.pdf" says that :
"ICapeThermoMaterialContext should be implemented by all Thermodynamic and Physical Properties components that need an ICapeThermoMaterial interface in order to set and get a Material's property values. "
ICapeThermoMaterialContext has two functions "SetMaterial" & "UnsetMaterial", and the "SetMaterial" is used for:
"The SetMaterial method allows a Thermodynamic and Physical Properties component, such as a Property Package, to be given the ICapeThermoMaterial interface of a Material Object. This interface gives the component access to the descript ion of the Material for which Property Calculations or Equilibrium Calculat ions are required. The component can access property values directly using this interface. A client can also use the ICapeThermoMaterial interface to query a Material Object for its ICapeThermoCompounds and ICapeThermoPhases interfaces, which provide access to Compound and Phase information, respectively. "
***------------***-------------***
But the "ICapeThermoMaterialContext" makes me puzzled, I compose the code like the following:
////code start
class ATL_NO_VTABLE CPropertyPackage :
public CAPEOPENBaseObject,
public CComCoClass<CPropertyPackage, &CLSID_PropertyPackage>,
public IDispatchImpl<ICapeThermoCompounds, &__uuidof(ICapeThermoCompounds), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoEquilibriumRoutine, &__uuidof(ICapeThermoEquilibriumRoutine), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoMaterialContext, &__uuidof(ICapeThermoMaterialContext), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoPhases, &__uuidof(ICapeThermoPhases), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoPropertyRoutine, &__uuidof(ICapeThermoPropertyRoutine), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoUniversalConstant, &__uuidof(ICapeThermoUniversalConstant), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoMaterial, &__uuidof(ICapeThermoMaterial), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeUtilities, &__uuidof(ICapeUtilities), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IPersistStream
////code end
Here I combine the "ICapeThermoMaterial" interface with all other interfaces. The "ICapeThermoMaterial" of a Material Object will be created when the "CPropertyPackage" is initialized.
So it's meaningless to use "SetMaterial" function to set the "ICapeThermoMaterial" interface, my code has create the "ICapeThermoMaterial" interface automaticly.
Is there something wrong with my thought, or should not I combine "ICapeThermoMaterial" with other interfaces?
"ICapeThermoMaterialContext should be implemented by all Thermodynamic and Physical Properties components that need an ICapeThermoMaterial interface in order to set and get a Material's property values. "
ICapeThermoMaterialContext has two functions "SetMaterial" & "UnsetMaterial", and the "SetMaterial" is used for:
"The SetMaterial method allows a Thermodynamic and Physical Properties component, such as a Property Package, to be given the ICapeThermoMaterial interface of a Material Object. This interface gives the component access to the descript ion of the Material for which Property Calculations or Equilibrium Calculat ions are required. The component can access property values directly using this interface. A client can also use the ICapeThermoMaterial interface to query a Material Object for its ICapeThermoCompounds and ICapeThermoPhases interfaces, which provide access to Compound and Phase information, respectively. "
***------------***-------------***
But the "ICapeThermoMaterialContext" makes me puzzled, I compose the code like the following:
////code start
class ATL_NO_VTABLE CPropertyPackage :
public CAPEOPENBaseObject,
public CComCoClass<CPropertyPackage, &CLSID_PropertyPackage>,
public IDispatchImpl<ICapeThermoCompounds, &__uuidof(ICapeThermoCompounds), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoEquilibriumRoutine, &__uuidof(ICapeThermoEquilibriumRoutine), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoMaterialContext, &__uuidof(ICapeThermoMaterialContext), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoPhases, &__uuidof(ICapeThermoPhases), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoPropertyRoutine, &__uuidof(ICapeThermoPropertyRoutine), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoUniversalConstant, &__uuidof(ICapeThermoUniversalConstant), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeThermoMaterial, &__uuidof(ICapeThermoMaterial), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IDispatchImpl<ICapeUtilities, &__uuidof(ICapeUtilities), &LIBID_CAPEOPEN110, /* wMajor = */ 1, /* wMinor = */ 1>,
public IPersistStream
////code end
Here I combine the "ICapeThermoMaterial" interface with all other interfaces. The "ICapeThermoMaterial" of a Material Object will be created when the "CPropertyPackage" is initialized.
So it's meaningless to use "SetMaterial" function to set the "ICapeThermoMaterial" interface, my code has create the "ICapeThermoMaterial" interface automaticly.
Is there something wrong with my thought, or should not I combine "ICapeThermoMaterial" with other interfaces?