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


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

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


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

示例1: Add

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

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

示例2: GetAccessDenied

STDMETHODIMP 
InterfaceSSLCertificates::get_Item(long Index, IInterfaceSSLCertificate **pVal)
{
   try
   {
      if (!m_pSSLCertificates)
         return GetAccessDenied();

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

示例3: GetAccessDenied

STDMETHODIMP 
InterfaceBlockedAttachments::get_ItemByDBID(long lDBID, IInterfaceBlockedAttachment **pVal)
{
   try
   {
      if (!m_pBlockedAttachments)
         return GetAccessDenied();

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

示例4: GetAccessDenied

STDMETHODIMP 
InterfaceIMAPFolders::get_ItemByDBID(long DBID, IInterfaceIMAPFolder **pVal)
{
   try
   {
      if (!m_pObject)
         return GetAccessDenied();

      CComObject<InterfaceIMAPFolder>* pIMAPFolderInt = new CComObject<InterfaceIMAPFolder>();
      pIMAPFolderInt->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::IMAPFolder> pIMAPFolder = m_pObject->GetItemByDBID(DBID);
   
      if (!pIMAPFolder)
         return DISP_E_BADINDEX;  
   
      pIMAPFolderInt->Attach(pIMAPFolder);
      pIMAPFolderInt->AttachParent(m_pObject, true);
      pIMAPFolderInt->AddRef();
      *pVal = pIMAPFolderInt;
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:jrallo,项目名称:hMailServer,代码行数:28,代码来源:InterfaceIMAPFolders.cpp

示例5: GetAccessDenied

STDMETHODIMP 
InterfaceGreyListingWhiteAddresses::get_Item(long Index, IInterfaceGreyListingWhiteAddress **pVal)
{
   try
   {
      if (!gl_white_addresses_)
         return GetAccessDenied();

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

示例6: Add

STDMETHODIMP InterfaceDistributionLists::Add(IInterfaceDistributionList **pVal)
{
   try
   {
      if (!m_pDistributionLists)
         return GetAccessDenied();

      if (!m_pDistributionLists)
         return m_pAuthentication->GetAccessDenied();
   
      CComObject<InterfaceDistributionList>* pList = new CComObject<InterfaceDistributionList>();
      pList->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::DistributionList> pPersList = shared_ptr<HM::DistributionList>(new HM::DistributionList);
      pPersList->SetDomainID(m_iDomainID);
   
      pList->AttachItem(pPersList);
      pList->AttachParent(m_pDistributionLists, false);
      pList->AddRef();
   
      *pVal = pList;
   
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:30,代码来源:InterfaceDistributionLists.cpp

示例7: get_Item

STDMETHODIMP InterfaceFetchAccounts::get_Item(long lIndex, IInterfaceFetchAccount** pVal)
{
   try
   {
      if (!m_pFetchAccounts)
         return GetAccessDenied();

      CComObject<InterfaceFetchAccount>* pInterfaceAccount = new CComObject<InterfaceFetchAccount>();
      pInterfaceAccount->SetAuthentication(m_pAuthentication);
   
      boost::shared_ptr<HM::FetchAccount> pFetchAccount = m_pFetchAccounts->GetItem(lIndex);
      if (!pFetchAccount)
         return DISP_E_BADINDEX;
   
      pInterfaceAccount->AttachItem(pFetchAccount);
      pInterfaceAccount->AttachParent(m_pFetchAccounts, true);
      pInterfaceAccount->AddRef();
      *pVal = pInterfaceAccount;   
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:bogri5520,项目名称:hMailServer,代码行数:26,代码来源:InterfaceFetchAccounts.cpp

示例8: 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

示例9: 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

示例10: get_Item

STDMETHODIMP InterfaceIMAPFolderPermissions::get_Item(long Index, IInterfaceIMAPFolderPermission **pVal)
{
   try
   {
      if (!m_pACLPermissions)
         return GetAccessDenied();

      CComObject<InterfaceIMAPFolderPermission>* pACLPermission = new CComObject<InterfaceIMAPFolderPermission>();
      pACLPermission->SetAuthentication(m_pAuthentication);
   
      shared_ptr<HM::ACLPermission> pPersACLPermission = m_pACLPermissions->GetItem(Index);
   
      if (!pPersACLPermission)
         return DISP_E_BADINDEX;  
   
      pACLPermission->AttachItem(pPersACLPermission);
      pACLPermission->AttachParent(m_pACLPermissions, true);
      pACLPermission->AddRef();
      *pVal = pACLPermission;
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:Bill48105,项目名称:hmailserver,代码行数:26,代码来源:InterfaceIMAPFolderPermissions.cpp

示例11: 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

示例12: Add

STDMETHODIMP InterfaceRules::Add(IInterfaceRule** pVal)
{
   try
   {
      if (!rules_)
         return GetAccessDenied();

      if (!rules_)
         return authentication_->GetAccessDenied();
   
      CComObject<InterfaceRule>* pIntDA = new CComObject<InterfaceRule>();
      pIntDA->SetAuthentication(authentication_);
   
      shared_ptr<HM::Rule> pDA = shared_ptr<HM::Rule>(new HM::Rule);
   
      // Make sure that the new rule is
      // added to the right account.
      pDA->SetAccountID(rules_->GetAccountID());
   
      pIntDA->AttachItem(pDA);
      pIntDA->AttachParent(rules_, false);
      pIntDA->AddRef();
   
      *pVal = pIntDA;
   
      return S_OK;   
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:34,代码来源:InterfaceRules.cpp

示例13: get_Item

STDMETHODIMP InterfaceRules::get_Item(long lIndex, IInterfaceRule** pVal)
{
   try
   {
      if (!rules_)
         return GetAccessDenied();

      CComObject<InterfaceRule>* pInterfaceRule = new CComObject<InterfaceRule>();
      pInterfaceRule->SetAuthentication(authentication_);
   
      shared_ptr<HM::Rule> pRule = rules_->GetItem(lIndex);
      if (!pRule)
         return DISP_E_BADINDEX;
   
      pInterfaceRule->AttachParent(rules_, true);
      pInterfaceRule->AttachItem(pRule);
      pInterfaceRule->AddRef();
      *pVal = pInterfaceRule;   
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:26,代码来源:InterfaceRules.cpp

示例14: get_ItemByDBID

STDMETHODIMP InterfaceFetchAccounts::get_ItemByDBID(long lDBID, IInterfaceFetchAccount** pVal)
{
   try
   {
      if (!fetch_accounts_)
         return GetAccessDenied();

      CComObject<InterfaceFetchAccount>* pInterfaceAccount = new CComObject<InterfaceFetchAccount>();
      pInterfaceAccount->SetAuthentication(authentication_);
   
      shared_ptr<HM::FetchAccount> pFetchAccount = fetch_accounts_->GetItemByDBID(lDBID);
      if (!pFetchAccount)
         return DISP_E_BADINDEX;
   
      pInterfaceAccount->AttachItem(pFetchAccount);
      pInterfaceAccount->AttachParent(fetch_accounts_, true);
      pInterfaceAccount->AddRef();
      *pVal = pInterfaceAccount;   
   
      return S_OK;
   }
   catch (...)
   {
      return COMError::GenerateGenericMessage();
   }
}
开发者ID:TreeSprite,项目名称:hmailserver,代码行数:26,代码来源:InterfaceFetchAccounts.cpp

示例15: GetAccessDenied

STDMETHODIMP
InterfaceSURBLServers::get_Item(long Index, IInterfaceSURBLServer **pVal)
{
    try
    {
        if (!m_pSURBLServers)
            return GetAccessDenied();

        CComObject<InterfaceSURBLServer>* pInterfaceSURBLServer = new CComObject<InterfaceSURBLServer>();
        pInterfaceSURBLServer->SetAuthentication(m_pAuthentication);

        shared_ptr<HM::SURBLServer> pDNSBlackList = m_pSURBLServers->GetItem(Index);

        if (!pDNSBlackList)
            return DISP_E_BADINDEX;

        pInterfaceSURBLServer->AttachItem(pDNSBlackList);
        pInterfaceSURBLServer->AttachParent(m_pSURBLServers, true);
        pInterfaceSURBLServer->AddRef();
        *pVal = pInterfaceSURBLServer;

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


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