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


C++ CAtlStringW::Right方法代码示例

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


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

示例1: GetImageType

DWORD IGFrame::GetImageType (LPCWSTR lpPicturePath)
{
	CAtlStringW cstrExtension (lpPicturePath);
	if (cstrExtension.GetLength() < 5)
		return CXIMAGE_FORMAT_UNKNOWN;	
	cstrExtension = cstrExtension.Right (4);
	// supported file extenstion length may be 2, 3 or 4
	if (cstrExtension.GetAt (0) == L'.')
		cstrExtension = cstrExtension.Right (3);
	else if (cstrExtension.GetAt (1) == L'.')
		cstrExtension = cstrExtension.Right (2);		
	cstrExtension.MakeUpper();
	if (cstrExtension == L"BMP")
		return CXIMAGE_FORMAT_BMP;
	else if (cstrExtension == L"JPG")
		return CXIMAGE_FORMAT_JPG;
	else if (cstrExtension == L"PNG")
		return CXIMAGE_FORMAT_PNG;
	else if (cstrExtension == L"ICO")
		return CXIMAGE_FORMAT_ICO;
	else if (cstrExtension == L"GIF")
		return CXIMAGE_FORMAT_GIF;
	else if (cstrExtension == L"TIF")
		return CXIMAGE_FORMAT_TIF;
	else if (cstrExtension == L"IG")
		return CXIMAGE_FORMAT_IG;
	return CXIMAGE_FORMAT_UNKNOWN;
}
开发者ID:Bitlsoft,项目名称:Imagenius_SDK,代码行数:28,代码来源:IGFrame.cpp

示例2: QueryHistory_InspectionRecord

HRESULT CDBHistory::QueryHistory_InspectionRecord(HDBCONNECTION hDBConnection, 
													SYSTEMTIME sysTimeFrom,
													SYSTEMTIME sysTimeTo,
													long l_LRUIndex,
													LPCWSTR lpszSerial,
													long	lResult,
													LPCWSTR lpszUserID,
													long	l_Index,
													LPDB_HISTORY_COMMON pRecord,
													BSTR* pbstrResult)
{
	HRESULT hr = E_FAIL;

	IMT::CDBConnection* pDBConnection = reinterpret_cast<IMT::CDBConnection*>(hDBConnection);
	if (pDBConnection != NULL)
	{
		ATL::CCommand<ATL::CAccessor<IMT::CDBHistory>> Command;

		ATL::CDBPropSet _DBPropSet(DBPROPSET_ROWSET);
		pDBConnection->GetRowsetProperties(&_DBPropSet);

		CAtlStringW strCommand;
		CAtlStringW strTemp;
		strCommand.Format(QUERY_USER_BY_VALID_CONDITIONS, sysTimeFrom.wYear,
														  sysTimeFrom.wMonth,
														  sysTimeFrom.wDay,
														  sysTimeTo.wYear,
														  sysTimeTo.wMonth,
														  sysTimeTo.wDay);

		BOOL isExist = FALSE;

		strTemp = strCommand;
		strCommand += L"AND ";

		if(l_LRUIndex != 0)
		{
			strTemp.Format(L"(LRU_Index = %d) ", l_LRUIndex);
			strCommand += strTemp;
			strTemp = strCommand;
			strCommand += L"AND ";
		}
		else
			TRACE(L"");

		if(::lstrcmpi(lpszSerial, L"Àüü") != 0)
		{
			strTemp.Format(L"(SerialNum = '%s') ", lpszSerial);
			strCommand += strTemp;
			strTemp = strCommand;
			strCommand += L"AND ";
		}
		else
			TRACE(L"");

		if(lResult != dfRESULT_ALL)
		{
			strTemp.Format(L"(State = %d) ", lResult);
			strCommand += strTemp;
			strTemp = strCommand;
			strCommand += L"AND ";
		}
		else
			TRACE(L"");

		if(::lstrcmpi(lpszUserID, L"Àüü") != 0)
		{
			strTemp.Format(L"(User = '%s') ", lpszUserID);
			strCommand += strTemp;
			strTemp = strCommand;
			strCommand += L"AND ";
		}
		else
			TRACE(L"");

		if(::lstrcmpi(strCommand.Right(4), L"AND ") == 0)
		{
			strCommand = strTemp;
		}
		else
			TRACE(L"");


		hr = Command.Open(ATL::CSession(*pDBConnection), strCommand, &_DBPropSet);
		if (hr != S_OK)
		{
			if (pbstrResult != NULL)
				IMT::GetDBErrorString(hr, pbstrResult);
		}
		else
		{
			TRACE(_T(":::[CDBHistory]-[QUERY] SUCCEEDED :::\n"));
			for(long i = 0; i < l_Index; i++)
			{
				hr = Command.MoveNext();
			}
			if (hr == S_OK)
				::CopyMemory(pRecord, LPDB_HISTORY_COMMON(Command), sizeof(DB_HISTORY_COMMON));
		}
	}
//.........这里部分代码省略.........
开发者ID:Hpark11,项目名称:FIES,代码行数:101,代码来源:DBHistory.cpp


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