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


C++ CString::Mid方法代码示例

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


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

示例1: GetIDString

WTL::CString CNBUnitDevice::GetIDString()
{
	WTL::CString strID = m_pDevice->m_BaseInfo.szDeviceStringId;
	WTL::CString strText;
	strID.Remove(_T('-'));

	strText += 
		strID.Mid(0, 5) + _T("-") +
		strID.Mid(5, 5) + _T("-") +
		strID.Mid(10, 5) + _T("-") + _T("*****");
	//		strID.Mid(0, 5) + _T("-") +

	return strText;
}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:14,代码来源:nbdev.cpp

示例2: GetStringID

WTL::CString CObjectUIHandler::GetStringID(CDiskObjectPtr obj) const
{
	WTL::CString strID = obj->GetStringDeviceID();
	WTL::CString strDashedID;
	strID.Remove(_T('-'));

	strDashedID += 
		strID.Mid(0, 5) + _T("-") +
		strID.Mid(5, 5) + _T("-") +
		strID.Mid(10, 5) + _T("-") + _T("*****");
//		strID.Mid(0, 5) + _T("-") +

	return strDashedID;

}
开发者ID:yzx65,项目名称:ndas4windows,代码行数:15,代码来源:nbuihandler.cpp

示例3: DetectVersion

DWORD WINAPI CMainDlg::DetectVersion(LPVOID lpParameter)
{
    CMainDlg *pThis = static_cast<CMainDlg *> (lpParameter);
    WTL::CString result;
    const wchar_t *p_versionstr;
    const wchar_t *p_versiondat;
    const wchar_t *p_term;
    DWORD res;
    int pos;

    pThis->m_edit.AppendText(L"Detecting scan executable\r\n");

    pThis->m_process = new Process(L"scan.exe /?");
    res = pThis->m_process->Exec(result);
    delete pThis->m_process;
    pThis->m_process = NULL;

    if (res) return -1;

    pos = result.Find(L"Scan engine v");

    if (pos == -1) /* V2 */
    {
        p_versionstr = L"McAfee VirusScan Command Line for Win32 Version: ";
        p_versiondat = L"Dat set version: ";
        p_term = L"\r";
        pThis->m_process = new Process(L"scan.exe /version");
        res = pThis->m_process->Exec(result);
        delete pThis->m_process;
        pThis->m_process = NULL;
        if (res) return -1;
        pos = result.Find(p_versionstr);
        if (pos == -1)
        {
            pThis->m_edit.AppendText(L"Unknown Version\r\n");
            return -1;
        }
        pThis->m_toolversion = 2;
    }
    else /* V1 */
    {
        p_versionstr = L"Scan engine v";
        p_versiondat = L"Virus data file v";
        p_term = L" ";
        pThis->m_toolversion = 1;
    }

    pos += wcslen(p_versionstr);
    WTL::CString verstr = result.Mid(pos);
    pos = verstr.Find(p_term);
    pThis->m_version = verstr.Left(pos);

    pos = result.Find(p_versiondat);
    if (pos == -1)
    {
        pThis->m_edit.AppendText(L"Cannot parse dat version\r\n");
        return -1;
    }

    pos += wcslen(p_versiondat);
    result = result.Mid(pos);
    pThis->m_datversion = _wtoi(result.GetBuffer(0));

    WTL::CString message;
    message.Format(L"Tool version %s - Dat Version %d\r\n", pThis->m_version,  pThis->m_datversion);
    pThis->m_edit.AppendText(message); 

    return 0;
}
开发者ID:sherpya,项目名称:naitool,代码行数:69,代码来源:naitool.cpp


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