本文整理汇总了C++中zimbra::util::ScopedInterface::GetEx方法的典型用法代码示例。如果您正苦于以下问题:C++ ScopedInterface::GetEx方法的具体用法?C++ ScopedInterface::GetEx怎么用?C++ ScopedInterface::GetEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zimbra::util::ScopedInterface
的用法示例。
在下文中一共展示了ScopedInterface::GetEx方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateExchangeMailBox
//.........这里部分代码省略.........
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): pGroup Add Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
GUID guid;
if(FAILED(hr = CoCreateGuid(&guid)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): CoCreateGuid Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
BYTE *str;
hr = UuidToString((UUID *)&guid, (RPC_WSTR *)&str);
if (hr != RPC_S_OK)
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): UuidToString Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
varProp.Clear();
//BYTE bytArr[]="3429bb3084703348b8023e94fabf16ea";
PutBinaryIntoVariant(&varProp,str,16);
RpcStringFree((RPC_WSTR *)&str);
if (FAILED(hr = pIADNewUser->Put(CComBSTR("msExchMailboxGuid"), varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put msExchMailboxGuid Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - msExchMailboxGuid Failed.");
if (FAILED(hr = ADsOpenObject(strContainer.c_str(), NULL, NULL, ADS_SECURE_AUTHENTICATION,
IID_IDirectoryObject, (void **)pIAdUser.getptr())))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): ADsOpenObject2 Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if (FAILED(hr = pIAdUser->QueryInterface(IID_IADs, (void**) pIAds.getptr())))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): pIAdUser->QueryInterface Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
varProp.Clear();
if( FAILED(hr= pIAds->Get(CComBSTR("msExchMailboxSecurityDescriptor"),&varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Get msExchMailboxSecurityDescriptor Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if (FAILED(hr = pIADNewUser->Put(CComBSTR("msExchMailboxSecurityDescriptor"), varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put msExchMailboxSecurityDescriptor Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - msExchMailboxSecurityDescriptor Failed.");
varProp.Clear();
if( FAILED(hr=pIAds->Get(CComBSTR("msExchPoliciesIncluded"),&varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Get msExchPoliciesIncluded Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if (FAILED(hr = pIADNewUser->Put(CComBSTR("msExchPoliciesIncluded"), varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put msExchPoliciesIncluded Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - msExchPoliciesIncluded Failed.");
varProp.Clear();
if( FAILED(hr= pIAds->Get(CComBSTR("msExchUserAccountControl"),&varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Get msExchUserAccountControl Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if (FAILED(hr = pIADNewUser->Put(CComBSTR("msExchUserAccountControl"), varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put msExchUserAccountControl Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - msExchUserAccountControl Failed.");
varProp.Clear();
if(FAILED(hr = pIAds->GetEx(CComBSTR("showInAddressBook"), &varProp )))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Get showInAddressBook Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->Put(CComBSTR("showInAddressBook"), varProp)))
{
throw ExchangeAdminException(hr, L"CreateExchangeMailBox(): Put showInAddressBook Failed.",
ERR_CREATE_EXCHMBX, __LINE__, __FILE__);
}
if(FAILED(hr = pIADNewUser->SetInfo()))
ThrowSetInfoException(hr, L"SetInfo - showInAddressBook Failed.");
return hr;
}