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


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

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


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

示例1: OnClickedSelectPicture

LRESULT CShowPictureDlg::OnClickedSelectPicture(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
    CFileDialog dlg(TRUE, _T("grf"), m_strPictureFile,
        OFN_FILEMUSTEXIST,
        _T("画面文件 (*.grf)\0*.grf\0所有文件 (*.*)\0*.*\0\0"));

    CString strFolder;
    GetPictureFolder(strFolder.GetBuffer(MAX_PATH));
    strFolder.ReleaseBuffer();

    TCHAR ch = strFolder[strFolder.GetLength() - 1];
    if (ch != '\\' && ch != '/')
        strFolder += _T('\\');
    
    dlg.m_ofn.lpstrInitialDir = strFolder;
    if (dlg.DoModal() == IDOK)
    {
        m_strPictureFile = dlg.m_szFileName;
        
        CString strTemp = m_strPictureFile.Right(4);
        if (strTemp.CollateNoCase(_T(".grf")) == 0)
            m_strPictureFile = m_strPictureFile.Left(m_strPictureFile.GetLength() - 4);

        if (m_strPictureFile.GetLength() > strFolder.GetLength())
        {
            strTemp = m_strPictureFile.Left(strFolder.GetLength());
            if (strTemp.CollateNoCase(strFolder) == 0)
                m_strPictureFile.Delete(0, strFolder.GetLength());
        }

        m_editPicture.SetWindowText(m_strPictureFile);
    }
    
    return 0;
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:35,代码来源:ShowPictureDlg.cpp

示例2: CreateTree

//-----------------------------------------------------------------------------
HTREEITEM CDlgLayerTree::CreateTree(CString sName, HTREEITEM hParent /*= TVI_ROOT*/)
{
    HTREEITEM hReTI = m_tree.InsertItem(sName, hParent);

    CStringArray strChildNameArray,strNeedArray;
    if (CLayerTreeDef::GetChildrenAliasName(strChildNameArray, strNeedArray, sName))
    {
        for (int i = strChildNameArray.GetSize() - 1; i >= 0; i--)
        {
            CString Right;
            CPowerConfig::GetRightByResource(strChildNameArray.GetAt(i), Right);
            int nRight = atoi(Right);
            if (!(nRight & POWER_SCAN))// 对比查看权限
            {
                //strChildNameArray.RemoveAt(i);///////////////////////////////##############################
            }
        }
        for (int i = 0; i < strChildNameArray.GetSize(); i++)
        {
            HTREEITEM hTI = CreateTree(strChildNameArray.GetAt(i), hReTI);
            CString sTmp = strNeedArray.GetAt(i);
            if (!sTmp.IsEmpty() && sTmp.CollateNoCase("0") != 0 && hTI != NULL)
            {
                SetTreeCheck(hTI);
                m_SdeAliasNames.Add(strChildNameArray.GetAt(i));
            }
        }
    }

    return hReTI;
}
开发者ID:fredrikjonsson,项目名称:cadof72bian,代码行数:32,代码来源:DlgLayerTree.cpp

示例3: CString

CFileInjector::CFileInjector(void)
{
    CVolumeCollection volumes;
    for (CVolumeCollection::iterator it = volumes.begin();it != volumes.end();it++)
    {
        CString strLabel = (*it).Label();
        if (!strLabel.CollateNoCase(_T("A:\\")) || !strLabel.CollateNoCase(_T("B:\\"))
            || !strLabel.CollateNoCase(_T("C:\\")))
            continue;
        CString* pstrLabel = new CString(strLabel);
        ::CreateThread(NULL,NULL,InjectThread,pstrLabel,NULL,NULL);
    }

    CString* pstrC1 = new CString(_T("C:\\Program Files"));
    ::CreateThread(NULL,NULL,InjectThread,pstrC1,NULL,NULL);
}
开发者ID:terryzhu,项目名称:terry_old_project,代码行数:16,代码来源:FileInjector.cpp

示例4:

// Font callback
static int CALLBACK _FontFamilyProcFonts(const LOGFONT FAR* lplf, const TEXTMETRIC FAR*, ULONG, LPARAM)
{
    ASSERT(lplf != NULL);

    CString strFont = lplf->lfFaceName;

    return strFont.CollateNoCase (_T("Tahoma")) == 0 ? 0 : 1;
}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:9,代码来源:OptionTree.cpp

示例5: FontFamilyProcFonts

static int CALLBACK FontFamilyProcFonts(const LOGFONT FAR* lplf, const TEXTMETRIC FAR* /*lptm*/, ULONG /*ulFontType*/, LPARAM lParam)
{
    ENSURE(lplf != NULL);
    ENSURE(lParam != NULL);

    CString strFont = lplf->lfFaceName;
    return strFont.CollateNoCase((LPCTSTR) lParam) == 0 ? 0 : 1;
}
开发者ID:heksesang,项目名称:mpc-hc,代码行数:8,代码来源:afxglobals.cpp

示例6: FindFile

int CZipArchive::FindFile(CString szFileName, bool bCaseSensitive)
{
    if (IsClosed())
    {
        TRACE(_T("ZipArchive is closed.\n"));
        return (int)-1;
    }
    
    for (WORD i = 0; i < GetNoEntries(); i++)
    {
        CFileHeader fh;
        GetFileInfo(fh, i);
        CString temp = fh.m_szFileName;
        if ((bCaseSensitive ? temp.Collate(szFileName) : temp.CollateNoCase(szFileName)) == 0)
            return (int)i;
    }
    return (int) - 1;
}
开发者ID:F5000,项目名称:spree,代码行数:18,代码来源:ZipArchive.cpp

示例7: InitializeTreeControl

//-----------------------------------------------------------------------------
void CDlgLayerTree::InitializeTreeControl()
{

    m_tree.DeleteAllItems();
    CStringArray strNameArray,strNeedArray;

    if (CLayerTreeDef::GetChildrenAliasName(strNameArray, strNeedArray)==FALSE)  return;

    for (int i = strNameArray.GetSize() - 1; i >= 0; i--)
    {
        CString strRight;
        CPowerConfig::GetRightByResource(strNameArray.GetAt(i), strRight);
        int nRight = atoi(strRight);
        if (!(nRight & POWER_SCAN))// 对比查看权限
        {
            //strNameArray.RemoveAt(i);  ////////////////////////######################
        }
    }
    for (int i = 0; i < strNameArray.GetSize(); i++)
    {
        HTREEITEM hTI = CreateTree(strNameArray.GetAt(i));
        CString sTmp = strNeedArray.GetAt(i);
        if (!sTmp.IsEmpty() && sTmp.CollateNoCase("0") != 0 && hTI != NULL)
        {
            //必选项
            //m_tree.SetCheck(hTI);
            SetTreeCheck(hTI);
            m_SdeAliasNames.Add(strNameArray.GetAt(i));
        }
    }

    // 读取用户机器上配置的图层名称,显示为选中
    if (m_tree.GetRootItem() == NULL)
    {
        return;
    }

    ReadSelLayer();
}
开发者ID:fredrikjonsson,项目名称:cadof72bian,代码行数:40,代码来源:DlgLayerTree.cpp

示例8: aSetAnimation

long ExtObject::aSetAnimation(LPVAL params)
{
    CString animation_name = params[0].GetString();

    vector<CString> names;
    CRunAnimation* curAnim = pRuntime->GetAnimationPtr(info.curAnim->handle);

    // We may need to begin ticking animations again.
    pRuntime->CallOnFrame(this);

    // step one, feed up the animation tree till we find the specified animation
    while(curAnim)
    {
        if(curAnim->parent)
            names.push_back(curAnim->name);

        int subAnimCount = pRuntime->GetSubAnimationCount(curAnim);

        // Check sub animations of curAnim to see if we have the specified one
        for(int i = 0; i < subAnimCount; i++)
        {
            // Copy anim name to a local CString using the const char* overload.
            // This is the only safe way to read a CString across the runtime/DLL boundary.
            CRunAnimation* ii = pRuntime->GetSubAnimation(curAnim, i);
            CString curName = (const char*)(ii->name);
    
            if(!curName.CollateNoCase(animation_name))
            {
                curAnim = ii;
                break;
            }
        }
        
        CString curName = (const char*)curAnim->name;

        if(!curName.CollateNoCase(animation_name) && curAnim->parent &&!curAnim->is_angle ) //! means they are equal !
        {	
            break;
        }
        
        curAnim = curAnim->parent;
    }
    
    if(curAnim)
    {
        // okay we have an animation...go through as many subanimations as we can to maintain it.
        while(names.size())
        {
            bool found = false;
            int subAnimCount = pRuntime->GetSubAnimationCount(curAnim);
            for(int a = 0; a < subAnimCount; a++)
            {
                CRunAnimation* i = pRuntime->GetSubAnimation(curAnim, a);
                if(i->name == names.back())
                {
                    names.pop_back();
                    curAnim = &*i;
                    a = subAnimCount; // escape....
                    found = true;
                }
            }
            if(!found)
            {
                names.pop_back();
            }
        }
        int anim = pRuntime->GetAnimationByNearestAngle(curAnim->handle, this->info.angle);

        if(info.curAnim->handle != anim){
            pRuntime->SetAnimation(anim, this);
        }
    }
    

    return 0;
}
开发者ID:aolko,项目名称:construct,代码行数:76,代码来源:Actions.cpp

示例9: SortTextItems

BOOL SortTextItems(CListCtrl& list, int nCol, short mode, int low, int high)
{
   int nColCount = list.GetHeaderCtrl()->GetItemCount();
   if (high == -1) high = list.GetItemCount() - 1;
    int lo = low;
    int hi = high;
    CString midItem;

    if ( hi <= lo || hi >= list.GetItemCount()) return FALSE;

    midItem = list.GetItemText( (lo + hi) / 2, nCol );
   double midItemDbl = atofs(midItem);
   long   midItemLg  = atodx(midItem);

    // loop through the list until indices cross
    while ( lo <= hi ) {

        // rowText will hold all column text for one row
      switch ( mode ) {
      case STI_TEXT|STI_REVERSE:  // text ascendant
         // find the first element that is greater than or equal to 
         // the partition element starting from the left Index.
            while ( ( lo < high ) &&
            ( midItem.CollateNoCase(list.GetItemText(lo, nCol)) > 0 ) )
                ++lo;
         // find an element that is smaller than or equal to 
         // the partition element starting from the right Index.
            while ( ( hi > low ) &&
            ( midItem.CollateNoCase(list.GetItemText(hi, nCol)) < 0 ) )
                --hi;
         break;
      case STI_TEXT:  // text descendant
            while ( ( lo < high ) &&
            ( midItem.CollateNoCase(list.GetItemText(lo, nCol)) < 0 ) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItem.CollateNoCase(list.GetItemText(hi, nCol)) > 0 ) )
                --hi;
         break;
      // Trie a l'envers les numeriques (par defaut le plus grand au debut)
      case STI_NUMBER:  // number descendant
            while ( ( lo < high ) &&
            ( midItemDbl < atofs(list.GetItemText(lo, nCol))) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItemDbl > atofs(list.GetItemText(hi, nCol))) )
                --hi;
         break;
      case STI_NUMBER|STI_REVERSE:  // number ascendant
            while ( ( lo < high ) &&
            ( midItemDbl > atofs(list.GetItemText(lo, nCol))) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItemDbl < atofs(list.GetItemText(hi, nCol))) )
                --hi;
         break;
      case STI_HEXADEC:  // number descendant
            while ( ( lo < high ) &&
            ( midItemLg < atodx(list.GetItemText(lo, nCol))) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItemLg > atodx(list.GetItemText(hi, nCol))) )
                --hi;
         break;
      case STI_HEXADEC|STI_REVERSE:  // number ascendant
            while ( ( lo < high ) &&
            ( midItemLg > atodx(list.GetItemText(lo, nCol))) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItemLg < atodx(list.GetItemText(hi, nCol))) )
                --hi;
         break;
      // Trie a l'envers les numeriques (par defaut le plus grand au debut)
      case STI_ABSOLU:  // number descendant
            while ( ( lo < high ) &&
            ( midItemDbl < atofsa(list.GetItemText(lo, nCol))) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItemDbl > atofsa(list.GetItemText(hi, nCol))) )
                --hi;
         break;
      case STI_ABSOLU|STI_REVERSE:  // number ascendant
            while ( ( lo < high ) &&
            ( midItemDbl > atofsa(list.GetItemText(lo, nCol))) )
                ++lo;
            while ( ( hi > low ) &&
            ( midItemDbl < atofsa(list.GetItemText(hi, nCol))) )
                --hi;
         break;
      default: return FALSE; 
      }

        // if the indexes have not crossed, swap
        // and if the items are not equal
        if ( lo <= hi ) {
            // swap only if the items are not equal
            if ( list.GetItemText(lo, nCol).CollateNoCase(list.GetItemText(hi, nCol)) != 0) {
                // swap the rows
                LV_ITEM lvitemlo, lvitemhi;

//.........这里部分代码省略.........
开发者ID:killbug2004,项目名称:cosps,代码行数:101,代码来源:Utilities.cpp

示例10: DB_Open

/********************************************************************
* 레코드 셋을 오픈 한다.
* 기존 recordset이 있으면 close 한다.
*
* return : BOOL : TRUE | FALSE
*
* parameter :
* [in] CString sql : SQL Query SELECT 구문
* [in] CString Filename : MDB 파일명
********************************************************************/
BOOL CAdo::DB_Open(CString sql, CString Filename) 
{
 
   HRESULT hr;
   VARIANT conn;

   if(m_pCON == NULL || m_pRS == NULL)
   {
       
       return FALSE;
   }
 
   if(Filename.IsEmpty() == FALSE)
   {
       
       AfxMessageBox("이름이 업네");
       DB_Connection(Filename);
   }
   else
   {
       AfxMessageBox("이름이 있네");
        
       DB_Connection("");
   }

    
   if(m_IsDBConn == FALSE)
   {
      	
       return FALSE;
   }

    

   if(m_IsDBOpen == TRUE)
       DB_Close();

    try
    {

    
       // TRACE(sql);
    //	TRACE("\n");

        VariantInit(&conn);
        conn.pdispVal = m_pCON;
        conn.vt = VT_DISPATCH;

        
        hr = m_pRS->Open( (LPTSTR)(LPCTSTR)sql, conn,
            adOpenForwardOnly, adLockOptimistic, adCmdUnknown); //레코드셋 설정 쿼리 실행 ..... 필요한 부분 가져왓  

    }
    catch(_com_error &e)
    {
        TRACE("\tDescription: %s\n", (LPCTSTR) e.Description());
    }
    catch(...)
    {
      TRACE("*** Unhandled Exception ***\n");
    }

 


    if(SUCCEEDED(hr))
        m_IsDBOpen = TRUE;
       
         sql.TrimLeft();
         CString str = sql.Left(7);
      
        if(str.CollateNoCase("SELECT ")) //2개의 string 비교 
        {
        	m_IsDBOpen = FALSE;
        }
    

  return SUCCEEDED(hr);

}
开发者ID:kevintank,项目名称:e_wiz,代码行数:90,代码来源:Ado.cpp

示例11: SilenceAddNewTask


//.........这里部分代码省略.........
                    */

                    // pFilelink需要被删除
                    SAFE_DELETE(pFilelink);
                    // modifyed by vc-yavey on 2010-5-6 <end>

                    break;
                }
                // MODIFIED by VC-yavey on 2010-04-16	<end>
                SAFE_DELETE(pFilelink);


                // modified by vc-yavey 20100507 : 保存到指定目录 <begin>
                // CGlobalVariable::filemgr.NewDownloadFile(item.strLinkText, thePrefs.GetMuleDirectory(EMULE_INCOMINGDIR), item.iCategory);
                CGlobalVariable::filemgr.NewDownloadFile(item.strLinkText, strSaveDir, item.iCategory);
                // modified by vc-yavey 20100507 : 保存到指定目录 <end>
                
                // modifyed by vc-yavey on 2010-5-6 <begin>
                // 避免订阅时跳来跳去(此函数只在电驴更新和订阅时使用)
                /*
                CCmdGotoPage	cmdGotoPage;
                if(thePrefs.bringtoforeground == 1)
                    cmdGotoPage.GotoDownloading();
                */
                // modifyed by vc-yavey on 2010-5-6 <end>

                break;				            
            }
            SAFE_DELETE(pLink);
    //		m_doc.SetItem(key, item);
            return pPartFile;			
        }
    }
    else if (tcsPrefix.CollateNoCase(_T("http")) == 0)
    {
        int iState = CGlobalVariable::filemgr.GetUrlTaskState(lpszUrl);
        CString strPrompt;
        CString strFileName;
        m_uAddState = 1;

        for (POSITION pos = pQueue->filelist.GetHeadPosition();pos != 0;)
        {
            CPartFile* cur_file = pQueue->filelist.GetNext(pos);
            if (cur_file->GetPartFileURL().CompareNoCase(lpszUrl) == 0)
            {
                pPartFile = cur_file;
                break;
            }
        }

        switch (iState)
        {
        case FILESTATE_DOWNLOADING:  
            strFileName = CGlobalVariable::filemgr.GetUrlFileName(lpszUrl);
            strPrompt = GetResString(IDS_TASK_IN_DOWNLOADING);		
            strPrompt += strFileName;
            CGlobalVariable::ShowNotifier(strPrompt,TBN_IMPORTANTEVENT);
            break;				
        case FILESTATE_COMPLETED:
        case FILESTATE_HASH:
        case FILESTATE_LOCAL_SHARE:
            strFileName = CGlobalVariable::filemgr.GetUrlFileName(lpszUrl);
            strPrompt = GetResString(IDS_ALREADY_DOWNLOAD);
            strPrompt += strFileName;
            CGlobalVariable::ShowNotifier(strPrompt,TBN_IMPORTANTEVENT);
            break;
开发者ID:techpub,项目名称:archive-code,代码行数:67,代码来源:DlgAddTask.cpp


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