int getIntProperty (const LPOLESTR name, const int defaultReturn) const { ComSmartPtr<IPropertyStorage> prop; if (FAILED (discRecorder->GetRecorderProperties (prop.resetAndGetPointerAddress()))) return defaultReturn; PROPSPEC iPropSpec; iPropSpec.ulKind = PRSPEC_LPWSTR; iPropSpec.lpwstr = name; PROPVARIANT iPropVariant; return FAILED (prop->ReadMultiple (1, &iPropSpec, &iPropVariant)) ? defaultReturn : (int) iPropVariant.lVal; }
bool setIntProperty (const LPOLESTR name, const int value) const { ComSmartPtr<IPropertyStorage> prop; if (FAILED (discRecorder->GetRecorderProperties (prop.resetAndGetPointerAddress()))) return false; PROPSPEC iPropSpec; iPropSpec.ulKind = PRSPEC_LPWSTR; iPropSpec.lpwstr = name; PROPVARIANT iPropVariant; if (FAILED (prop->ReadMultiple (1, &iPropSpec, &iPropVariant))) return false; iPropVariant.lVal = (long) value; return SUCCEEDED (prop->WriteMultiple (1, &iPropSpec, &iPropVariant, iPropVariant.vt)) && SUCCEEDED (discRecorder->SetRecorderProperties (prop)); }