
interface IDShape
{
...
properties
{
VT_FLOAT Width
dispid 999
get proc HrOamShapeGetWidth
}
}
...
STDMETHODIMPC HrOamShapeGetWidth(IDShape *pidsp, float *pflWidth)
{
int fIDispatch = vrf.fIDispatch;
int fObjModelCall = vfObjModelCall;
Generic *pgen = PgenFromPunk(pidsp);
OASO *poaso = (OASO *)LpvFromGenericInstanceData(
HRESULT hr = poaso->HrGetWidth(pflWidth);
vrf.fIDispatch = fIDispatch;
vfObjModelCall = fObjModelCall;
return HrRaiseExcepHr(pidsp, hr);
}
New:interface IDShape
class_handler OASO
{
...
properties
{
VT_FLOAT Width
dispid 999
read_only
}
}
And both need:
HRESULT OASO::HrGetWidth(float *pflWidth)
{
*pflWidth = PtFromEmu(PspInternal()->flWidth());
return S_OK;
}
(Some code facts and names have been changed, but it's a representative sample.)