本文整理汇总了C++中CStdStringW::AllocSysString方法的典型用法代码示例。如果您正苦于以下问题:C++ CStdStringW::AllocSysString方法的具体用法?C++ CStdStringW::AllocSysString怎么用?C++ CStdStringW::AllocSysString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStdStringW
的用法示例。
在下文中一共展示了CStdStringW::AllocSysString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDocIDDescription
HRESULT DMSHelper::GetDocIDDescription(const CStdStringW& sDocumentID, CStdStringW& sDescription)
{
LOG_WS_FUNCTION_SCOPE_MSG(sDocumentID);
BSTR bsDocID = sDocumentID.AllocSysString();
BSTR bsDescription = NULL;
sDescription = _T("");
HRESULT hr = GetDocProvProxy()->GetDocIDDescription(bsDocID, &bsDescription);
::SysFreeString(bsDocID);
if (SUCCEEDED(hr) && bsDescription != NULL)
{
sDescription = bsDescription;
SysFreeString(bsDescription);
}
else
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
return hr;
}
示例2: TranslateODMAID
HRESULT DMSHelper::TranslateODMAID(CStdStringW sODMAID, CStdStringW& sDocID)
{
LOG_WS_FUNCTION_SCOPE_MSG(sDocID);
BSTR bsODMAID = sODMAID.AllocSysString();
BSTR bsDocID = NULL;
sDocID = _T("");
HRESULT hr = GetDocProvProxy()->TranslateODMAID(bsODMAID, &bsDocID);
::SysFreeString(bsODMAID);
if (SUCCEEDED(hr) && bsDocID != NULL)
{
sDocID = bsDocID;
SysFreeString(bsDocID);
}
else
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
return hr;
}
示例3: LockDocumentAsOtherUserForTesting
HRESULT DMSHelper::LockDocumentAsOtherUserForTesting(const CStdStringW& sDocumentID, const CStdStringW& sUserName, const CStdStringW& sPassword, long lLockFlags)
{
BSTR bsDocID = sDocumentID.AllocSysString();
BSTR bsUserName = sUserName.AllocSysString();
BSTR bsPassword = sPassword.AllocSysString();
HRESULT hr = GetDocProvProxy()->LockDocumentAsOtherUserForTesting(bsDocID, bsUserName, bsPassword, lLockFlags);
if (FAILED(hr))
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
::SysFreeString(bsDocID);
::SysFreeString(bsUserName);
::SysFreeString(bsPassword);
return E_NOTIMPL;
}
示例4: SelectDocumentEx
HRESULT DMSHelper::SelectDocumentEx(long lHWnd, CStdStringW sFormatString, CStdStringW sCurrentDocumentID, CStdStringW& sDocumentID)
{
HRESULT hr = E_FAIL;
BSTR bstrFormatString = sFormatString.AllocSysString();
BSTR bstrDocumentID = NULL;
BSTR bstrCurrentDocumentID = sCurrentDocumentID.AllocSysString();
try
{
hr = GetDocProvProxy()->SelectDocumentEx(lHWnd, bstrFormatString,bstrCurrentDocumentID, &bstrDocumentID);
}
catch(_com_error& e)
{
LOG_WS_ERROR(e.Description());
hr = e.Error();
}
catch(...)
{
LOG_WS_ERROR(_T("SelectDocumentEx unknown error"));
hr = E_FAIL;
}
if (SUCCEEDED(hr) && bstrDocumentID != NULL)
{
sDocumentID = bstrDocumentID;
SysFreeString(bstrDocumentID);
}
else
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
SysFreeString(bstrFormatString);
SysFreeString(bstrCurrentDocumentID);
return hr;
}
示例5: DemoteToDocument
HRESULT DMSHelper::DemoteToDocument(const CStdStringW& sDocumentID)
{
BSTR bsDocID = sDocumentID.AllocSysString();
HRESULT hr = GetDocProvProxy()->DemoteToDocument(bsDocID);
if (FAILED(hr))
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
::SysFreeString(bsDocID);
return hr;
}
示例6: LockDocument
HRESULT DMSHelper::LockDocument(const CStdStringW& sDocumentID, long lLockFlags)
{
LOG_WS_FUNCTION_SCOPE_MSG(sDocumentID);
BSTR bsDocID = sDocumentID.AllocSysString();
HRESULT hr = GetDocProvProxy()->LockDocument(bsDocID, lLockFlags);
if (FAILED(hr))
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
::SysFreeString(bsDocID);
return hr;
}
示例7: VersionDocument
//so you must call save first if you dont want to lose your changes
//returns the DocID of the newly created version
HRESULT DMSHelper::VersionDocument(CStdStringW& szDocumentID, const CStdStringW& sComment)
{
LOG_WS_FUNCTION_SCOPE_MSG(szDocumentID);
BSTR bstrDocumentID = szDocumentID.AllocSysString();
HRESULT hRes = GetDocProvProxy()->VersionDocument(&bstrDocumentID, _bstr_t(sComment));
if(FAILED(hRes))
{
CStdString sErr(_T("DMSHelper::VersionDocument failed on document : "));
sErr+= szDocumentID;
LOG_WS_ERROR(sErr.c_str());
}
if(bstrDocumentID != NULL)
{
szDocumentID = bstrDocumentID;
::SysFreeString(bstrDocumentID);
}
return hRes;
}
示例8: GetDocumentLockStatus
HRESULT DMSHelper::GetDocumentLockStatus(CStdStringW sDocumentID, long* plLockStatus, CStdStringW& sLockedBy)
{
LOG_WS_FUNCTION_SCOPE_MSG(sDocumentID);
HRESULT hr = E_FAIL;
BSTR bstrDocID = sDocumentID.AllocSysString();
BSTR bstrLockedBy = NULL;
try
{
hr = GetDocProvProxy()->GetDocumentLockStatus(bstrDocID, plLockStatus, &bstrLockedBy);
}
catch(_com_error& e)
{
LOG_WS_ERROR(e.Description());
hr = e.Error();
}
catch(...)
{
LOG_WS_ERROR(_T("GetDocumentLockStatus unknown error"));
hr = E_FAIL;
}
if (SUCCEEDED(hr) && bstrLockedBy != NULL)
{
sLockedBy = bstrLockedBy;
SysFreeString(bstrLockedBy);
}
else
{
CStdString sError;
sError.Format(_T("hr = %x"), hr);
LOG_WS_ERROR(sError.c_str());
}
SysFreeString(bstrDocID);
return hr;
}
示例9: PromoteToSynergy
HRESULT DMSHelper::PromoteToSynergy(CStdStringW& sDocumentID, CStdStringW& sErrorReason)
{
CStdString sErr;
CStdString sErrReason(_T(""));
BSTR bsDocID = sDocumentID.AllocSysString();
HRESULT hr = GetDocProvProxy()->PromoteToSynergy(&bsDocID);
if (SUCCEEDED(hr) && bsDocID != NULL)
{
sDocumentID = bsDocID;
::SysFreeString(bsDocID);
}
else
{
GetDocProvProxy()->GetErrorDescription(hr,sErrReason);
sErr.Format(_T("GetSynergyRelatedDocuments failed, error code %08x, %s"),hr,sErrReason.c_str());
LOG_WS_ERROR(sErr.c_str());
}
return hr;
}