STDMETHODIMP CPropertyChoice::AddActionsByCLSID (CALPCLSID *pcaClsIds) { HRESULT hr = E_FAIL; if (!m_fIsInitialized) { hr = InitNew(); if (FAILED(hr)) return hr; } // hinzufügen der einzelnen Aktionen for (ULONG i = 0; i < pcaClsIds -> cElems; i++) { try { WPropertyAction WAct (*(pcaClsIds -> ppElems[i])); // throws hr { WPersistStreamInit Init = WAct; // throws hr hr = Init -> InitNew(); if (FAILED(hr)) _com_issue_error(hr); } hr = AddAction (WAct); if (FAILED(hr)) _com_issue_error(hr); } catch (_com_error& hr) { return _COM_ERROR(hr); } } return NOERROR; }
HRESULT CPigMissionParams::FinalConstruct() { // Initialize the data InitNew(); // Indicate success return S_OK; }
/////////////////////////////////////////////////////////////////////////////// // IPropertyActionSequence methods STDMETHODIMP CPropertyChoice::AddAction (IPropertyAction *pIAct) { if (!m_fIsInitialized) { HRESULT hr = InitNew(); if (FAILED(hr)) return hr; } COM_TRY { m_Actions.push_back (CAction(pIAct)); m_fIsDirty = true; } COM_CATCH; return S_OK; }
/////////////////////////////////////////////////////////////////////////////// // IPropertyActionSequence methods STDMETHODIMP CPropertyChoice::AddAction (IPropertyAction *pIAct) { if (!m_fIsInitialized) { HRESULT hr = InitNew(); if (FAILED(hr)) return hr; } try { m_Actions.push_back (CAction(pIAct)); m_fIsDirty = true; } catch (...) { ASSERT(false); return E_FAIL; } return NOERROR; }
STDMETHODIMP CPropertyChoice::GetDescription (LPSTR pDesc, ULONG ulLen, ULONG *pulWritten) { if (NULL == pDesc) return E_POINTER; if (0 == ulLen) return E_INVALIDARG; if (!m_fIsInitialized) { HRESULT hr = InitNew(); if (FAILED(hr)) return hr; } ULONG ulL = tmin((ULONG)m_strDesc.length(), ulLen-1); strncpy (pDesc, m_strDesc.c_str(), ulL); pDesc[ulL] = '\0'; if (pulWritten) *pulWritten = ulL; return NOERROR; }
STDMETHODIMP CPropertyChoice::AddActionsByCLSID (CALPCLSID *pcaClsIds) { HRESULT hr = E_FAIL; if (!m_fIsInitialized) { hr = InitNew(); if (FAILED(hr)) return hr; } // hinzufügen der einzelnen Aktionen for (ULONG i = 0; i < pcaClsIds -> cElems; i++) { COM_TRY { WPropertyAction WAct (*(pcaClsIds -> ppElems[i])); // throws hr THROW_FAILED_HRESULT(WPersistStreamInit(WAct) -> InitNew()); THROW_FAILED_HRESULT(AddAction (WAct)); } COM_CATCH; } return NOERROR; }
void XmlBuilder::Clear() { DropDoc(); InitNew( "UTF-8" ); }