本文整理汇总了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;
}
示例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));
}
}
//.........这里部分代码省略.........