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


C++ CStdString::AllocSysString方法代码示例

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


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

示例1: GetErrorDescription

STDMETHODIMP CDocProvider::GetErrorDescription(LONG lError, VARIANT varStringInsert, BSTR *pszErrorText)
{
    COM_METHOD_TRY
    CResourceSwapper rs(_Module.m_hInstResource);

    HRESULT hRes = S_OK;
    *pszErrorText = NULL;

    if (HRESULT_FACILITY(lError) != WSDOC)
        hRes = E_NOTIMPL;
    else
    {
        CStdString sError =CErrorTranslator::GetWSDocProvErrorDescription(lError);
        if(sError.IsEmpty())
        {
            hRes = E_FAIL;
        }
        else
            *pszErrorText = sError.AllocSysString();
    }

    if (hRes == E_NOTIMPL)
    {
        if (FAILED(VerifyConnection(_T(""), false, false)))
            return E_FAIL;

        CStdString sError = CErrorTranslator::GetErrorDescriptionFromDocProvider(lError, m_mapProviders, m_pCurrentDocumentProvider);
        *pszErrorText = sError.AllocSysString();
        hRes = S_OK;
    }
    return hRes;
    COM_METHOD_CATCH
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:WSComponent.cpp

示例2: TestRelateSynergyDocument

void TestCOMLayer::TestRelateSynergyDocument()
{
	CStdString csDocumentID = _T("Bug of the Century");
	BSTR bsDocumentId = csDocumentID.AllocSysString();
	WSDocNonCom wsdDocIn;
	wsdDocIn.SetAuthor(CStdString(_T("Alfie")));
	wsdDocIn.SetClass(CStdString(_T("PreSchool")));
	wsdDocIn.SetDescription(CStdString(_T("Short and fluffy")));
	wsdDocIn.SetDocId(CStdString(_T("afnb")));
	wsdDocIn.SetExtension(CStdString(_T("Dummy")));
	wsdDocIn.SetFileSizehigh(24);
	wsdDocIn.SetFileSizeLow(2);
	wsdDocIn.SetFlags(0x54407);
	wsdDocIn.SetLocalFile(CStdString(_T("Tractor")));
	wsdDocIn.SetModifiedTime(20011127.080230);
	wsdDocIn.SetOperator(CStdString(_T("Keith")));
	wsdDocIn.SetType(CStdString(_T("Boy")));
	LOCALFILESTORELib::tagWSDOCUMENT wsDoc;
	wsdDocIn.InitializeWSDOCUMENT((WSDOCUMENT*)&wsDoc);

	WSDOCUMENTPROVIDERLib::ISynergyDocumentRelatorPtr pRel = m_pLFS;


	HRESULT hr = pRel->raw_RelateSynergyDocument((WSDOCUMENTPROVIDERLib::tagWSDOCUMENT*)&wsDoc, bsDocumentId);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("RelateSynergyDocument"));
	assertTest(wsdDocIn == m_pWorker->m_wsd);
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	SysFreeString(bsDocumentId);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:30,代码来源:TestCOMLayer.cpp

示例3: CanPromote

HRESULT DocProvHelper::CanPromote(CStdString sDocID)
{
	if (m_pCurrentDocumentProvider==NULL)
		return E_NO_PROVIDER_SELECTED;
	else
	{
		CComPtr<IWSDocumentProvider3> pDocProvider3;
		long lLockStatus;
		BSTR szUser = NULL;
		_bstr_t sDocument = sDocID.AllocSysString();
		HRESULT hRes = m_pCurrentDocumentProvider->QueryInterface(IID_IWSDocumentProvider3, (void**)&pDocProvider3);
		if(FAILED(hRes))
			return hRes;

		HRESULT hr = pDocProvider3->GetDocumentLockStatus(sDocument,&lLockStatus,&szUser);

		if(szUser != NULL)
			::SysFreeString(szUser);

		if(FAILED(hr))
			return hr;

		return GetReturnResultFromLockStatus(lLockStatus);
	}

	return E_FAIL;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:27,代码来源:DocProvHelper.cpp

示例4: TestSelectDocumentEx

void TestCOMLayer::TestSelectDocumentEx()
{
	CStdString sFormatString = _T("Weebles wobble but they don't fall down");
	BSTR bsFormat = sFormatString.AllocSysString();
	CStdString csCurrentDocumentID = _T("This document has a name. It's not just a number.");
	BSTR bsCurrentDocumentID = csCurrentDocumentID.AllocSysString();
	BSTR bsDocumentID = NULL;
	HRESULT hr = m_pLFS->raw_SelectDocumentEx(4816100, bsFormat, bsCurrentDocumentID, &bsDocumentID);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("SelectDocumentEx"));
	assertTest(CStdString(bsDocumentID) == m_pWorker->m_sDocumentIDToReturn);
	assertTest(csCurrentDocumentID == m_pWorker->m_sDocumentID);
	assertTest(m_pWorker->m_sFormatString == sFormatString);
	assertTest(m_pWorker->m_hwnd == (HWND)4816100);
	SysFreeString(bsFormat);
	SysFreeString(bsDocumentID);
	SysFreeString(bsCurrentDocumentID);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:18,代码来源:TestCOMLayer.cpp

示例5: TestVersionDocument

void TestCOMLayer::TestVersionDocument()
{
	CStdString csDocumentID = _T("Weebles wobble but they don't fall down");
	BSTR bsDocumentID = csDocumentID.AllocSysString();

	CStdString csComment = _T("What am I supposed to say?");
	BSTR bsComment = csComment.AllocSysString();
	
	HRESULT hr = m_pLFS->raw_VersionDocument(&bsDocumentID, bsComment);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("VersionDocument"));
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	assertTest(CStdString(bsDocumentID) == m_pWorker->m_sDocumentIDToReturn);
	assertTest(m_pWorker->m_sComment == csComment);

	SysFreeString(bsDocumentID);
	SysFreeString(bsComment);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:18,代码来源:TestCOMLayer.cpp

示例6: TestDeleteDocument

void TestCOMLayer::TestDeleteDocument()
{
	CStdString csDocumentID = _T("Weebles wobble but they don't fall down");
	BSTR bsDocumentID = csDocumentID.AllocSysString();
	HRESULT hr = m_pLFS->raw_DeleteDocument(bsDocumentID);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("DeleteDocument"));
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	SysFreeString(bsDocumentID);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:10,代码来源:TestCOMLayer.cpp

示例7: TestSetCallingApplication

void TestCOMLayer::TestSetCallingApplication()
{
	CStdString csApplicationName = _T("Lego");
	BSTR bsApplicationName = csApplicationName.AllocSysString();
	HRESULT hr = m_pLFS->raw_SetCallingApplication(bsApplicationName);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("SetCallingApplication"));
	assertTest(m_pWorker->m_sApplication == csApplicationName);
	SysFreeString(bsApplicationName);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:10,代码来源:TestCOMLayer.cpp

示例8: TestLockDocumentAsOtherUser

void TestCOMLayer::TestLockDocumentAsOtherUser()
{
	CStdString csDocumentID = _T("Noggin the Nog");
	CStdString csUserName = _T("Nogbad the Bad");
	CStdString csPassword = _T("Zebedee");
	BSTR bsDocumentID = csDocumentID.AllocSysString();
	BSTR bsUserName = csUserName.AllocSysString();
	BSTR bsPassword = csPassword.AllocSysString();
	HRESULT hr = m_pLFS->raw_LockDocumentAsOtherUserForTesting(bsDocumentID, bsUserName, bsPassword, 666);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("LockDocumentAsOtherUser"));	
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	assertTest(m_pWorker->m_sUserName == csUserName);
	assertTest(m_pWorker->m_sPassword == csPassword);
	assertTest(m_pWorker->m_lFlags == 666);
	SysFreeString(bsDocumentID);
	SysFreeString(bsUserName);
	SysFreeString(bsPassword);

}
开发者ID:killbug2004,项目名称:WSProf,代码行数:20,代码来源:TestCOMLayer.cpp

示例9: PopulateBSTRWithPageInfo

void PrintManager::PopulateBSTRWithPageInfo(BSTR* pBSTR, int* pages, int nSize)
{
	std::vector<int> vecNoOfPages;
	for(int i = 0; i<nSize; i++)
	{
		vecNoOfPages.push_back(pages[i]);
	}

	CStdString sPages = PrintManagerHelper::FormatPageNumbers(vecNoOfPages);
	(*pBSTR) = sPages.AllocSysString();
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:11,代码来源:PrintManager.cpp

示例10: TestDisplayProfile

void TestCOMLayer::TestDisplayProfile()
{
	CStdString csDocumentID = _T("Weebles wobble but they don't fall down");
	BSTR bsDocumentID = csDocumentID.AllocSysString();
	HRESULT hr = m_pLFS->raw_DisplayProfile(bsDocumentID, 329);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("DisplayProfile"));
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	assertTest(m_pWorker->m_lFlags == 329);
	SysFreeString(bsDocumentID);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:11,代码来源:TestCOMLayer.cpp

示例11: VersionTestDoc

CStdString DMTests_Helper::VersionTestDoc(CStdString sTestDocID)
{
	BSTR bsDocID = sTestDocID.AllocSysString();

	HRESULT hr = GetDocProvider2()->VersionDocument(&bsDocID, _T("Test comment"));

	if(FAILED(hr))
	{
		throw std::exception("Failed to version the test document in the DMS");
	}
	return bsDocID;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:12,代码来源:DMTests_Helper.cpp

示例12: TestGetLatestVersion

void TestCOMLayer::TestGetLatestVersion()
{
	CStdString csDocumentID = _T("Weebles wobble but they don't fall down");
	BSTR bsDocumentID = csDocumentID.AllocSysString();

	HRESULT hr = m_pLFS->raw_GetLatestVersion(&bsDocumentID);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("GetLatestVersion"));
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	assertTest(CStdString(bsDocumentID) == m_pWorker->m_sDocumentIDToReturn);

	SysFreeString(bsDocumentID);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:13,代码来源:TestCOMLayer.cpp

示例13: TestSelectDocument

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//TESTS
void TestCOMLayer::TestSelectDocument()
{
	CStdString sFormatString = _T("Weebles wobble but they don't fall down");
	BSTR bsFormat = sFormatString.AllocSysString();
	BSTR bsDocumentID = NULL;
	HRESULT hr = m_pLFS->raw_SelectDocument(23, bsFormat, &bsDocumentID);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("SelectDocument"));
	assertTest(CStdString(bsDocumentID) == m_pWorker->m_sDocumentIDToReturn);
	assertTest(m_pWorker->m_sFormatString == sFormatString);
	assertTest(m_pWorker->m_hwnd == (HWND)23);
	SysFreeString(bsFormat);
	SysFreeString(bsDocumentID);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:17,代码来源:TestCOMLayer.cpp

示例14: TestAddHistoryEvent

void TestCOMLayer::TestAddHistoryEvent()
{
	CStdString csApplicationName = _T("Lego");
	BSTR bsApplicationName = csApplicationName.AllocSysString();
	CStdString csDocumentID = _T("Weebles wobble but they don't fall down");
	BSTR bsDocumentID = csDocumentID.AllocSysString();
	CStdString csComment = _T("What am I supposed to say?");
	BSTR bsComment = csComment.AllocSysString();

	HRESULT hr = m_pLFS->raw_AddHistoryEvent(bsDocumentID, 11, 22, 33, bsApplicationName, bsComment);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("AddHistoryEvent"));
	assertTest(m_pWorker->m_sApplication == csApplicationName);
	assertTest(m_pWorker->m_sDocumentID == csDocumentID);
	assertTest(m_pWorker->m_sComment == csComment);
	assertTest(m_pWorker->m_lAcitivity == 11);
	assertTest(m_pWorker->m_lDuration == 22);
	assertTest(m_pWorker->m_lPagesPrinted == 33);

	SysFreeString(bsApplicationName);
	SysFreeString(bsDocumentID);
	SysFreeString(bsComment);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:23,代码来源:TestCOMLayer.cpp

示例15: TestGetDocumentLockStatus

void TestCOMLayer::TestGetDocumentLockStatus()
{
	CStdString csDocumentID = _T("Weebles wobble but they don't fall down");
	BSTR bsDocumentID = csDocumentID.AllocSysString();
	long lLockStatus = 0;
	BSTR bsUser = NULL;
	HRESULT hr = m_pLFS->raw_GetDocumentLockStatus(bsDocumentID, &lLockStatus, &bsUser);
	assertTest(hr == S_TEST);
	assertTest(m_pWorker->m_sLastMethodCalled == _T("GetDocumentLockStatus"));
	assertTest(lLockStatus == m_pWorker->m_lLockStatusToReturn);
	assertTest(CStdString(bsUser) == m_pWorker->m_sUserToReturn);
	SysFreeString(bsDocumentID);
	SysFreeString(bsUser);

}
开发者ID:killbug2004,项目名称:WSProf,代码行数:15,代码来源:TestCOMLayer.cpp


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