本文整理汇总了C++中hm::String::AllocSysString方法的典型用法代码示例。如果您正苦于以下问题:C++ String::AllocSysString方法的具体用法?C++ String::AllocSysString怎么用?C++ String::AllocSysString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hm::String
的用法示例。
在下文中一共展示了String::AllocSysString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_String
STDMETHODIMP InterfaceLanguage::get_String(BSTR EnglishString, BSTR *pVal)
{
try
{
if (!language_)
return GetAccessDenied();
HM::String sText = language_->GetString(EnglishString);
*pVal = sText.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例2: sInput
STDMETHODIMP InterfaceUtilities::SHA256(BSTR Input, BSTR *Output)
{
try
{
HM::String sInput(Input);
HM::String sOutput = HM::Crypt::Instance()->EnCrypt(sInput, HM::Crypt::ETSHA256);
*Output = sOutput.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例3: get_Address
STDMETHODIMP InterfaceTCPIPPort::get_Address(BSTR *pVal)
{
try
{
if (!m_pObject)
return GetAccessDenied();
HM::String sIPAddress = m_pObject->GetAddressString();
*pVal = sIPAddress.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例4: get_Name
STDMETHODIMP InterfaceLanguage::get_Name(BSTR *pVal)
{
try
{
if (!language_)
return GetAccessDenied();
HM::String sName = language_->GetName();
*pVal = sName.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例5: GetAccessDenied
STDMETHODIMP
InterfaceIMAPFolder::get_Name(BSTR *pVal)
{
try
{
if (!m_pObject)
return GetAccessDenied();
HM::String sUnicode = HM::ModifiedUTF7::Decode(m_pObject->GetFolderName());
*pVal = sUnicode.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例6: get_RecipientAddress
STDMETHODIMP InterfaceDistributionListRecipient::get_RecipientAddress(BSTR *pVal)
{
try
{
if (!m_pObject)
return GetAccessDenied();
HM::String sVal = m_pObject->GetAddress();
*pVal = sVal.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例7: TestSpamAssassinConnection
STDMETHODIMP InterfaceAntiSpam::TestSpamAssassinConnection(BSTR hostname, long port, BSTR *messageText, VARIANT_BOOL *pResult)
{
try
{
if (!m_pConfig)
return GetAccessDenied();
HM::SpamAssassinTestConnect testClient;
HM::String text;
*pResult = testClient.TestConnect(hostname, port, text) ? VARIANT_TRUE : VARIANT_FALSE;
*messageText = text.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例8: TestClamAVScanner
STDMETHODIMP InterfaceAntiVirus::TestClamAVScanner(BSTR hostname, long port, BSTR *messageText, VARIANT_BOOL *pResult)
{
try
{
if (!GetIsServerAdmin())
return GetAccessDenied();
HM::VirusScannerTester testClient;
HM::String text;
*pResult = testClient.TestClamAVConnect(hostname, port, text) ? VARIANT_TRUE : VARIANT_FALSE;
*messageText = text.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例9: TestClamWinScanner
STDMETHODIMP InterfaceAntiVirus::TestClamWinScanner(BSTR clamWinExecutable, BSTR clamWinDatabase, BSTR *messageText, VARIANT_BOOL *pResult)
{
try
{
if (!GetIsServerAdmin())
return GetAccessDenied();
HM::VirusScannerTester testClient;
HM::String text;
*pResult = testClient.TestClamWinVirusScanner(clamWinExecutable, clamWinDatabase, text) ? VARIANT_TRUE : VARIANT_FALSE;
*messageText = text.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例10: get_DatabaseName
STDMETHODIMP InterfaceDatabase::get_DatabaseName(BSTR *pVal)
{
try
{
if (!config_)
return GetAccessDenied();
if (!GetIsServerAdmin())
return GetAccessDenied();
HM::String sServerName = ini_file_settings_->GetDatabaseName();
*pVal = sServerName.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}
示例11: get_LogFile
STDMETHODIMP InterfaceBackupSettings::get_LogFile(BSTR *pVal)
{
try
{
if (!config_)
return GetAccessDenied();
HM::String sLogDir = ini_file_settings_->GetLogDirectory();
if (sLogDir.Right(1) != _T("\\"))
sLogDir += "\\";
sLogDir += "hmailserver_backup.log";
*pVal = sLogDir.AllocSysString();
return S_OK;
}
catch (...)
{
return COMError::GenerateGenericMessage();
}
}