当前位置: 首页>>代码示例>>C++>>正文


C++ CComObject::AttachItem方法代码示例

本文整理汇总了C++中CComObject::AttachItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CComObject::AttachItem方法的具体用法?C++ CComObject::AttachItem怎么用?C++ CComObject::AttachItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComObject的用法示例。


在下文中一共展示了CComObject::AttachItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Add

STDMETHODIMP InterfaceIMAPFolderPermissions::Add(IInterfaceIMAPFolderPermission **pVal)
{
   try
   {
      if (!m_pACLPermissions)
         return GetAccessDenied();

      if (!m_pAuthentication->GetIsDomainAdmin())
         return m_pAuthentication->GetAccessDenied();
   
      if (!m_pACLPermissions)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceIMAPFolderPermission>* pIntACLPermission = new CComObject<InterfaceIMAPFolderPermission>();
      pIntACLPermission->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::ACLPermission> pACLPermission = shared_ptr<HM::ACLPermission>(new HM::ACLPermission);
   
      pACLPermission->SetShareFolderID(m_pFolder->GetID());
   
      pIntACLPermission->AttachItem(pACLPermission);
      pIntACLPermission->AttachParent(m_pACLPermissions, false);
   
      pIntACLPermission->AddRef();
      *pVal = pIntACLPermission;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:33,代码来源:InterfaceIMAPFolderPermissions.cpp

示例2: GetAccessDenied

STDMETHODIMP 
InterfaceBlockedAttachments::Add(IInterfaceBlockedAttachment **pVal)
{
   try
   {
      if (!m_pBlockedAttachments)
         return GetAccessDenied();

      if (!m_pBlockedAttachments)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceBlockedAttachment>* pInterfaceBlockedAttachment = new CComObject<InterfaceBlockedAttachment>();
      pInterfaceBlockedAttachment->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::BlockedAttachment> pBA = shared_ptr<HM::BlockedAttachment>(new HM::BlockedAttachment);
   
      pInterfaceBlockedAttachment->AttachItem(pBA);
      pInterfaceBlockedAttachment->AttachParent(m_pBlockedAttachments, false);
   
      pInterfaceBlockedAttachment->AddRef();
   
      *pVal = pInterfaceBlockedAttachment;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:jrallo,项目名称:hMailServer,代码行数:30,代码来源:InterfaceBlockedAttachments.cpp

示例3: get_Item

STDMETHODIMP InterfaceAliases::get_Item(long Index, IInterfaceAlias **pVal)
{
   try
   {
      if (!m_pAliases)
         return GetAccessDenied();

      CComObject<InterfaceAlias>* pAlias = new CComObject<InterfaceAlias>();
      pAlias->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::Alias> pPersAlias = m_pAliases->GetItem(Index);
   
      if (!pPersAlias)
         return DISP_E_BADINDEX;  
   
      pAlias->AttachItem(pPersAlias);
      pAlias->AddRef();
      *pVal = pAlias;
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:jrallo,项目名称:hMailServer,代码行数:25,代码来源:InterfaceAliases.cpp

示例4: get_Alias

STDMETHODIMP InterfaceLinks::get_Alias(long DBID, IInterfaceAlias **pVal)
{
   try
   {
      if (!authentication_->GetIsAuthenticated())
         return authentication_->GetAccessDenied();
   
      shared_ptr<HM::Alias> pAlias = shared_ptr<HM::Alias>(new HM::Alias);
      if (!HM::PersistentAlias::ReadObject(pAlias, DBID))
         return DISP_E_BADINDEX;
   
      bool domainAdminOK = authentication_->GetIsDomainAdmin() && authentication_->GetDomainID() == pAlias->GetDomainID();
   
      if (!authentication_->GetIsServerAdmin() && !domainAdminOK)
         return authentication_->GetAccessDenied();
   
      CComObject<InterfaceAlias>* pInterface = new CComObject<InterfaceAlias>();
      pInterface->SetAuthentication(authentication_);
      pInterface->AttachItem(pAlias);
      pInterface->AddRef();
      *pVal = pInterface;
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:28,代码来源:InterfaceLinks.cpp

示例5: GetAccessDenied

STDMETHODIMP 
InterfaceIMAPFolderPermission::get_Group(IInterfaceGroup **pVal)
{
   try
   {
      if (!object_)
         return GetAccessDenied();

      CComObject<InterfaceGroup>* pInterfaceGroup = new CComObject<InterfaceGroup>();
      pInterfaceGroup->SetAuthentication(authentication_);
   
      std::shared_ptr<HM::Group> pGroup = HM::Configuration::Instance()->GetIMAPConfiguration()->GetGroups()->GetItemByDBID(object_->GetPermissionGroupID());
   
      if (!pGroup)
         return DISP_E_BADINDEX;
   
      pInterfaceGroup->AttachItem(pGroup);
      pInterfaceGroup->AddRef();
      *pVal = pInterfaceGroup;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:27,代码来源:InterfaceIMAPFolderPermission.cpp

示例6: GetAccessDenied

STDMETHODIMP 
InterfaceGreyListingWhiteAddresses::Add(IInterfaceGreyListingWhiteAddress **pVal)
{
   try
   {
      if (!gl_white_addresses_)
         return GetAccessDenied();

      if (!gl_white_addresses_)
         return authentication_->GetAccessDenied();
   
      CComObject<InterfaceGreyListingWhiteAddress>* pInterfaceGreyListingWhiteAddress = new CComObject<InterfaceGreyListingWhiteAddress>();
      pInterfaceGreyListingWhiteAddress->SetAuthentication(authentication_);
   
      shared_ptr<HM::GreyListingWhiteAddress> pBA = shared_ptr<HM::GreyListingWhiteAddress>(new HM::GreyListingWhiteAddress);
   
      pInterfaceGreyListingWhiteAddress->AttachItem(pBA);
      pInterfaceGreyListingWhiteAddress->AttachParent(gl_white_addresses_, false);
      pInterfaceGreyListingWhiteAddress->AddRef();
   
      *pVal = pInterfaceGreyListingWhiteAddress;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:29,代码来源:InterfaceGreyListingWhiteAddresses.cpp

示例7: GetAccessDenied

STDMETHODIMP 
InterfaceSSLCertificates::Add(IInterfaceSSLCertificate **pVal)
{
   try
   {
      if (!m_pSSLCertificates)
         return GetAccessDenied();

      if (!m_pSSLCertificates)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceSSLCertificate>* pInterfaceSSLCertificate = new CComObject<InterfaceSSLCertificate>();
      pInterfaceSSLCertificate->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::SSLCertificate> pBA = shared_ptr<HM::SSLCertificate>(new HM::SSLCertificate);
   
      pInterfaceSSLCertificate->AttachItem(pBA);
      pInterfaceSSLCertificate->AttachParent(m_pSSLCertificates, false);
      pInterfaceSSLCertificate->AddRef();
   
      *pVal = pInterfaceSSLCertificate;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:29,代码来源:InterfaceSSLCertificates.cpp

示例8: get_Item

STDMETHODIMP InterfaceIncomingRelays::get_Item(long Index, IInterfaceIncomingRelay **pVal)
{
   try
   {
      if (!m_pIncomingRelays)
         return GetAccessDenied();

      CComObject<InterfaceIncomingRelay>* pRangeInt = new CComObject<InterfaceIncomingRelay>();
      pRangeInt->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::IncomingRelay> pRange = m_pIncomingRelays->GetItem(Index);
   
      if (pRange)
      {
         pRangeInt->AttachItem(pRange);
         pRangeInt->AttachParent(m_pIncomingRelays, true);
         pRangeInt->AddRef();
         *pVal = pRangeInt;
      }
      else
      {
         return DISP_E_BADINDEX;  
      }
   
   
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:33,代码来源:InterfaceIncomingRelays.cpp

示例9: get_ItemByDBID

STDMETHODIMP InterfaceMessages::get_ItemByDBID(hyper DBID, IInterfaceMessage **pVal)
{
   try
   {
      if (!messages_)
         return GetAccessDenied();

      //	

      CComObject<InterfaceMessage>* pInterfaceMessage = new CComObject<InterfaceMessage>();
      pInterfaceMessage->SetAuthentication(authentication_);

      std::shared_ptr<HM::Message> pMsg = messages_->GetItemByDBID(DBID);

      if (pMsg)
      {
         pInterfaceMessage->AttachItem(pMsg);
         pInterfaceMessage->AddRef();
         *pVal = pInterfaceMessage;
      }
      else
      {
         return DISP_E_BADINDEX;
      }

      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:hmailserver,项目名称:hmailserver,代码行数:32,代码来源:InterfaceMessages.cpp

示例10: GetAccessDenied

STDMETHODIMP 
InterfaceSURBLServers::get_ItemByDBID(long lDBID, IInterfaceSURBLServer **pVal)
{
   try
   {
      if (!surbl_servers_)
         return GetAccessDenied();

      CComObject<InterfaceSURBLServer>* pInterfaceSURBLServer = new CComObject<InterfaceSURBLServer>();
      pInterfaceSURBLServer->SetAuthentication(authentication_);
   
      std::shared_ptr<HM::SURBLServer> pDNSBlackList = surbl_servers_->GetItemByDBID(lDBID);
   
      if (!pDNSBlackList)
         return DISP_E_BADINDEX;
   
      pInterfaceSURBLServer->AttachItem(pDNSBlackList);
      pInterfaceSURBLServer->AttachParent(surbl_servers_, true);
      pInterfaceSURBLServer->AddRef();
   
      *pVal = pInterfaceSURBLServer;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:29,代码来源:InterfaceSURBLServers.cpp

示例11: Add

STDMETHODIMP InterfaceIncomingRelays::Add(IInterfaceIncomingRelay **pVal)
{
   try
   {
      if (!m_pIncomingRelays)
         return GetAccessDenied();

      if (!m_pIncomingRelays)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceIncomingRelay>* pInterfaceRange = new CComObject<InterfaceIncomingRelay>();
      pInterfaceRange->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::IncomingRelay> pRange = shared_ptr<HM::IncomingRelay>(new HM::IncomingRelay); 
   
      pInterfaceRange->AttachItem(pRange);
      pInterfaceRange->AttachParent(m_pIncomingRelays, false);
   
      pInterfaceRange->AddRef();
      *pVal = pInterfaceRange;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:28,代码来源:InterfaceIncomingRelays.cpp

示例12: GetAccessDenied

STDMETHODIMP 
InterfaceIMAPFolder::get_Permissions(IInterfaceIMAPFolderPermissions **pVal)
{
   try
   {
      if (!m_pObject)
         return GetAccessDenied();

      if (!m_pObject->IsPublicFolder())
      {
         // This is not a public  folder. Not possible to modify permissions.
         return COMError::GenerateError("It is only possible to modify permissions for public folders.");
      }
   
      CComObject<InterfaceIMAPFolderPermissions>* pItem = new CComObject<InterfaceIMAPFolderPermissions >();
      pItem->SetAuthentication(m_pAuthentication);
   
      if (m_pObject)
      {
         pItem->AttachItem(m_pObject);
         pItem->AddRef();
         *pVal = pItem;
      }
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:bogri5520,项目名称:hMailServer,代码行数:31,代码来源:InterfaceIMAPFolder.cpp

示例13: Add

STDMETHODIMP InterfaceAccounts::Add(IInterfaceAccount **pVal)
{
   try
   {
      if (!m_pAccounts)
         return GetAccessDenied();

      if (!m_pAuthentication->GetIsDomainAdmin())
         return m_pAuthentication->GetAccessDenied();
   
      if (!m_pAccounts)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceAccount>* pAccountInterface = new CComObject<InterfaceAccount>();
      pAccountInterface->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::Account> pAccount = shared_ptr<HM::Account>(new HM::Account);
   
      pAccount->SetDomainID(m_iDomainID);
      
      pAccountInterface->AttachItem(pAccount);
      pAccountInterface->AttachParent(m_pAccounts, false);
      pAccountInterface->SetAuthentication(m_pAuthentication);
      pAccountInterface->AddRef();
   
      *pVal = pAccountInterface;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:34,代码来源:InterfaceAccounts.cpp

示例14: get_ItemByAddress

STDMETHODIMP InterfaceAccounts::get_ItemByAddress(BSTR Address, IInterfaceAccount **pVal)
{
   try
   {
      if (!m_pAccounts)
         return GetAccessDenied();

   
      CComObject<InterfaceAccount>* pAccountInt = new CComObject<InterfaceAccount>();
      pAccountInt->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::Account> pAccount = m_pAccounts->GetItemByName(Address);
   
      if (!pAccount)
         return DISP_E_BADINDEX; 
   
      pAccountInt->AttachItem(pAccount);
      pAccountInt->SetAuthentication(m_pAuthentication);
      pAccountInt->AttachParent(m_pAccounts, true);
      pAccountInt->AddRef();
      *pVal = pAccountInt;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:29,代码来源:InterfaceAccounts.cpp

示例15: Add

STDMETHODIMP InterfaceFetchAccounts::Add(IInterfaceFetchAccount **pVal)
{
   try
   {
      if (!m_pFetchAccounts)
         return GetAccessDenied();

      if (!m_pFetchAccounts)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceFetchAccount>* pIntFA = new CComObject<InterfaceFetchAccount>();
      pIntFA->SetAuthentication(m_pAuthentication);
   
      boost::shared_ptr<HM::FetchAccount> pFA = boost::shared_ptr<HM::FetchAccount>(new HM::FetchAccount);
   
      pFA->SetAccountID(m_pFetchAccounts->GetAccountID());
   
      pIntFA->AttachItem(pFA);
      pIntFA->AttachParent(m_pFetchAccounts, false);
   
      pIntFA->AddRef();
      *pVal = pIntFA;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:bogri5520,项目名称:hMailServer,代码行数:30,代码来源:InterfaceFetchAccounts.cpp


注:本文中的CComObject::AttachItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。