Example #1
0
int CMimicFile::GetMimicList(vector<CString>& MimicInfoList)
{
	DWORD t1 = GetTickCount();
	char				SrcfilePathFile[255];
	WIN32_FIND_DATA     FindFileData;
	HANDLE				handle;
	MimicInfoList.clear();

	//获取系统图存放路径
	char SrcfilePath[255];
	GetPrivateProfileString("Drawings Dir", "MimicPath", "C:\\Drawings", SrcfilePath, 255, MIMICSYSCONFINI);

	//判断路径是否存在
	if (_access(SrcfilePath, 0) == -1)
	{
		return -1;
	}
	sprintf_s(SrcfilePathFile, "%s\\*.grb", SrcfilePath);
	handle = FindFirstFile(SrcfilePathFile, &FindFileData);
	if (handle != INVALID_HANDLE_VALUE)
	{
		BOOL		bResult = TRUE;
		CString		csGrb;
		while (bResult)
		{
			csGrb.Format("%s", FindFileData.cFileName);
			if(csGrb.GetLength() != 12)
			{
				bResult = FindNextFile(handle, &FindFileData);
				continue;
			}
			csGrb.MakeUpper();
			csGrb = csGrb.Left(8);

			//检查图是否合法的图
			if(CheckGrbValid(csGrb) == TRUE)
			{
				MimicInfoList.push_back(csGrb);

				//修改文件名为全大写
				CString OriFile = FindFileData.cFileName;
				CString DstFile = OriFile;
				if (OriFile != DstFile.MakeUpper())
				{
					CString PathFile;
					PathFile.Format("%s\\%s", SrcfilePath, DstFile);
					BOOL b = MoveFile(PathFile, PathFile);
				}
			}
			bResult = FindNextFile(handle, &FindFileData);
		}
	}
	FindClose(handle);

	DWORD t2 = GetTickCount();
	TRACE("GetMimicInfoList()耗时=%dms\n", t2 - t1);

	return (int)MimicInfoList.size();
}
Example #2
0
BOOL CCJShellTree::SearchTree(HTREEITEM treeNode, CString szSearchName, FindAttribs attr)
{
	LPTVITEMDATA	lptvid;  //Long pointer to TreeView item data
	LPSHELLFOLDER	lpsf2=NULL;
	char	drive[_MAX_DRIVE];
	char	dir[_MAX_DIR];
	char	fname[_MAX_FNAME];
	char	ext[_MAX_EXT];
	BOOL	bRet=FALSE;
	HRESULT	hr;
	CString	strCompare;
	
	szSearchName.MakeUpper();
	while(treeNode && bRet==FALSE)
	{
		lptvid=(LPTVITEMDATA)GetItemData(treeNode);
		if (lptvid && lptvid->lpsfParent && lptvid->lpi)
		{
			hr=lptvid->lpsfParent->BindToObject(lptvid->lpi,
				0,IID_IShellFolder,(LPVOID *)&lpsf2);
			if (SUCCEEDED(hr))
			{
				ULONG ulAttrs = SFGAO_FILESYSTEM;
				lptvid->lpsfParent->GetAttributesOf(1, (const struct _ITEMIDLIST **)&lptvid->lpi, &ulAttrs);
				if (ulAttrs & (SFGAO_FILESYSTEM))
				{
					if(SHGetPathFromIDList(lptvid->lpifq,strCompare.GetBuffer(MAX_PATH)))
					{
						switch(attr)
						{
						case type_drive:
							m_shell.SplitPath(strCompare,drive,dir,fname,ext);
							strCompare=drive;
							break;
						case type_folder:
							strCompare = GetItemText(treeNode);
							break;
						}
						strCompare.MakeUpper();
						if(strCompare == szSearchName)
						{
							EnsureVisible(treeNode);
							SelectItem(treeNode);
							bRet=TRUE;
						}
					}
				}
				lpsf2->Release();
			}
		}
		treeNode = GetNextSiblingItem(treeNode);
	}
	return bRet;
}
Example #3
0
BOOL CPreStylePag::DeleteTextStyle(CString strTSName)
{
    CMObject obj, tsobj;
    long     i, nCount;
    CString  strtmp;

    //进行参数检查和初始化
    strTSName.TrimLeft();
    strTSName.TrimRight();
    strTSName.MakeUpper();
    if(strTSName.GetLength() <= 0) return FALSE;

    try
    {
        if(FindAcad() == FALSE)
        {
            return FALSE;
        }
        
        //SETUP-1: 获取ACAD文本样式列表
        obj = EDIBAcad::objAcadDoc.GetPropertyByName(
                                      _T("TextStyles"));
        
        //SETUP-2: 获取样式对象
		nCount = (long)obj.GetPropertyByName(_T("Count"));
		for( i = 0; i < nCount; i++)
		{
			tsobj = obj.Invoke(_T("Item"), 1, &_variant_t(i));
			strtmp = vtos(tsobj.GetPropertyByName(_T("Name")));
			strtmp.TrimLeft();
            strtmp.TrimRight();
			strtmp.MakeUpper();
			if(strtmp == strTSName)
			{
                //删除目标样式
                tsobj.Invoke0(_T("Delete"));
                return TRUE;
			}
		}
    }
	catch (_com_error &e)
	{
		CString strMsg;
		strMsg.Format("%s:%d %s", __FILE__, __LINE__, (LPSTR)e.Description());
		AfxMessageBox(strMsg);
	}
    catch(...)
    {
    }
    return FALSE;
}
Example #4
0
////////////////////////////////////////////////////////////////////////
// IsGoodKey
//
bool CKeyRegistry::IsGoodKey()
{
	CString sName = GetName();
    int  length   = sName.GetLength();
	WORD result   = (WORD) GetKey();

	if (IsTemporaryKey())
	{
		time_t time = 0;
		DWORD dwValue = GetValue("key", 0);

		if (dwValue == 0)
			return true;

		CTime date((time_t)dwValue);

		int days = abs((CTime::GetCurrentTime() - date).GetDays());

		if (days > 15)
			return true;
	}

	sName.MakeUpper();

    for (int i = 0; i < length; i++)
      result -= (((WORD)sName[i]) << ((i + 3) % 7));

	return true;//(result == 0xFADE && length > 2);
}
Example #5
0
BOOL CVolume::ValidateLabel(const CString& strLabel)
{
	CString strTemp = strLabel;
	strTemp.Trim();

	// Check length.
	if (strTemp.IsEmpty() || strTemp.GetLength() >3) return FALSE;

	// Check label.
	strTemp.MakeUpper();
	TCHAR chLabel = strTemp.GetAt(0);
	if (chLabel < _T('A') || chLabel > _T('Z')) return FALSE;

	// Check whole string.
	switch (strTemp.GetLength())
	{
	case 1:
		return TRUE;
	case 2:
		{
			CString strCompare;
			strCompare.Format(_T("%c:"),chLabel);
			return strTemp.CompareNoCase(strCompare) ? FALSE : TRUE;
		}
	case 3:
		{
			CString strCompare;
			strCompare.Format(_T("%c:\\"),chLabel);
			return strTemp.CompareNoCase(strCompare) ? FALSE : TRUE;
		}
	default: 
		return FALSE;
	}
}
Example #6
0
void MyDialog4::AddRoute(unsigned int Dest, unsigned int Gate, int Metric,
						 char *Int)
{
	CString DestStr;
	CString GateStr;
	CString MetricStr;
	CString IntStr;
	int Idx;

	DestStr.Format("%d.%d.%d.%d",
		((unsigned char *)&Dest)[0], ((unsigned char *)&Dest)[1],
		((unsigned char *)&Dest)[2], ((unsigned char *)&Dest)[3]);

	GateStr.Format("%d.%d.%d.%d",
		((unsigned char *)&Gate)[0], ((unsigned char *)&Gate)[1],
		((unsigned char *)&Gate)[2], ((unsigned char *)&Gate)[3]);

	MetricStr.Format("%d", Metric);

	IntStr.Format("%c%c%c%c", Int[0], Int[1], Int[2], Int[3]);
	IntStr.MakeUpper();

	Idx = m_RoutingTable.GetItemCount();

	m_RoutingTable.InsertItem(Idx, DestStr);

	m_RoutingTable.SetItemText(Idx, 1, GateStr);
	m_RoutingTable.SetItemText(Idx, 2, MetricStr);
	m_RoutingTable.SetItemText(Idx, 3, IntStr);
}
Example #7
0
//截取Section
void CINIsoc::CutString(char* fid, int len, CString& sFile)
{
	char *pline_head = fid;
	int readtotal = 0;
	//纳入内存池,从缓存中申请,更快
	char* buf = theApp.m_memPool.NewMem(KEY_BUF);
	if(NULL==buf)
		return;
	memset(buf,0,KEY_BUF);
	DWORD wRet = 0;
	for(int i=0;i<len;i++)
	{
		if(fid[i] == 0x0)
		{
			CString str ;
			str.Format("%s",pline_head);
			//截取Section中的keys
			wRet = 0;
			wRet = ::GetPrivateProfileSection(str,buf,KEY_BUF,sFile);//某个section的所有内容
			if(wRet > 0){
				ATF_MAP atf_map;
				CutString(buf,wRet,atf_map);
				str.MakeUpper(); //统一大写 2011.10.17
				//插入节点
				m_SectMap.insert( SECT_PAIRMAP( str, atf_map ) );
			}
			if(fid[i+1] == 0x0)
				break;//字段结束;
			pline_head = fid+i+1;
		}
	}
	//纳入内存池
	theApp.m_memPool.FreeMem(buf);
}
Example #8
0
//查询数据key值
CString CINIsoc::FindCode(CString Section, CString Key)
{
	if( Section.IsEmpty() || Key.IsEmpty() )
		return "";
	//查询Section
	Section.MakeUpper(); //2011.10.17 大写
	SECT_IT sect_it = m_SectMap.find(Section);
	if( sect_it != m_SectMap.end() )
	{
		//查询key
		Key.MakeUpper(); //2011.10.17 大写
		ATF_IT atf_it = sect_it->second.find(Key);
		if( atf_it != sect_it->second.end() )
			return atf_it->second;//Key值
	}
	return "";
}
Example #9
0
//赋值
//	-szKey: 字段名,例如"IV_MOBILE_TEL"
//	-szVal: 值,例如_variant_t("13588866419")
bool CADO::SetParamByName( CString szKey, _variant_t szVal)
{
#ifdef XWB_SQL_LINK //2013.06.06 xuwb 兼容SQL Server数据库
	szKey = "@" + szKey;
#endif
	szKey.MakeUpper();
	return ((CStoreObj*)m_pObj)->SetParameterVal(szKey,szVal);
}
Example #10
0
//读取执行结果 -- OUT参数,单个参数
_variant_t CADO::GetOutVal(CString sOutName)
{
#ifdef XWB_SQL_LINK //2013.06.06 xuwb 兼容SQL Server数据库
	sOutName = "@" + sOutName;
#endif
	sOutName.MakeUpper();
	return ((CStoreObj*)m_pObj)->GetOutVal( sOutName );
}
Example #11
0
CString CDlgDialbox::GetBthComPort(CString sAddr) {
	CString sRtn = "";
	int iPort = 0;

	HKEY hKey1;
	DWORD dwNameLen1 = MAX_PATH;
	char pcName1[MAX_PATH + 1];

	LONG lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Enum\\BTHENUM", NULL, KEY_READ | KEY_ENUMERATE_SUB_KEYS, &hKey1);
	if (lResult != ERROR_SUCCESS) return sRtn;

	for (DWORD dwIndex1=0; ; dwIndex1++) {
		dwNameLen1 = MAX_PATH;
		lResult = RegEnumKeyEx( hKey1, dwIndex1, pcName1, &dwNameLen1, NULL, NULL, NULL, NULL);
		if (lResult == ERROR_NO_MORE_ITEMS) break;
		if (lResult != ERROR_SUCCESS) { continue;}
		HKEY hKey2;
		DWORD dwNameLen2 = MAX_PATH;
		char pcName2[MAX_PATH + 1];

		CString sSubKey;
		sSubKey.Format("SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\%s", pcName1);
		lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, sSubKey, NULL, KEY_READ | KEY_ENUMERATE_SUB_KEYS, &hKey2);
		if (lResult != ERROR_SUCCESS) {continue;}

		for (DWORD dwIndex2=0; ; dwIndex2++) {
			dwNameLen2 = MAX_PATH;
			lResult = RegEnumKeyEx(hKey2, dwIndex2, pcName2, &dwNameLen2, NULL, NULL, NULL, NULL);
			if (lResult == ERROR_NO_MORE_ITEMS) break;
			if (lResult != ERROR_SUCCESS) continue;

			sSubKey.Format("SYSTEM\\CurrentControlSet\\Enum\\BTHENUM\\%s\\%s", pcName1, pcName2);
			sSubKey.MakeUpper();

			if(sSubKey.Find(sAddr) < 0) continue;

			HKEY hKey3;
			char pcPort[100 + 1];
			DWORD dwLen = 100;
			if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, sSubKey + "\\Device Parameters", 0, KEY_READ, &hKey3) != ERROR_SUCCESS) continue;
			if (RegQueryValueEx(hKey3, "PortName", NULL, NULL, (LPBYTE)&pcPort, &dwLen) == ERROR_SUCCESS) {
				RegCloseKey(hKey3);
				pcPort[dwLen] = 0;
				CString sPort(pcPort);
				sPort.MakeUpper();
				if(sPort.Find("COM") >= 0) {
					sRtn = sPort;
//					sRtn += sSubKey + "\r\n" + sPort + "\r\n";
				}
			}
		}//for(dwIndex2++)
		RegCloseKey(hKey2);
    }//for(dwIndex1++)
    RegCloseKey(hKey1);
//	AfxMessageBox(sRtn + "\r\n" + sAddr);
	return sRtn;
}
Example #12
0
//////////////////////////////////////////////////////////////////////
// private Funktionen
//////////////////////////////////////////////////////////////////////
///Diese Funktion wandelt ein Wort, wie z.B. On oder True in einen Wahrheitswert um.
int CIniLoader::StringToInt(const CString& sValue)
{
    CString sTemp = sValue;
    sTemp.MakeUpper();
    if (sTemp == "ON" || sTemp == "1" || sTemp == "TRUE")
        return 1;
    else
        return 0;
}
Example #13
0
void CVolume::NormalizeLabel(CString& strLabel)
{
	if (!ValidateLabel(strLabel)) return;

	strLabel.MakeUpper();
	if (strLabel.GetLength() == 2)
		strLabel += _T("\\");
	else if (strLabel.GetLength() == 1)
		strLabel += _T(":\\");
}
CString CFindServersDlg::GetHostByAddr(const in_addr& Addr)
{
	CString	s;
	HOSTENT	*he = gethostbyaddr((char *)&Addr,
		sizeof(in_addr), AF_INET);	// try getting host entry
	// if host entry was found and contains a valid host name
	if (he != NULL && he->h_name != NULL && he->h_name[0]) {
		s = he->h_name;	// show host name
		s.MakeUpper();
	} else	// get host name failed
		s = inet_ntoa(Addr);	// show dotted IP instead
	return(s);
}
Example #15
0
void CDnaCore::SetClientCode(LPCTSTR newVal)
{
    CString NewCode = newVal;

    if(NewCode.GetLength() < 4)
        return;
    if(NewCode.GetLength() > 4)
        NewCode = NewCode.Left(4);

    NewCode.MakeUpper();

    m_gnuCore->m_ClientCode = NewCode;
}
Example #16
0
//读取执行结果 -- 应答表
CString CSObj::FieldByName(CString vtName)
{
	try //2011.12.22 对于空值列取值会报异常做的特例化处理
	{
		vtName.MakeUpper();
		_variant_t vtVal( (LPSTR)(LPCTSTR)vtName );
		return Get_VARIANT_bstrVal( pRs->GetCollect( vtVal ) );
	}
	catch(...)
	{
	}
	return _T("");
}
Example #17
0
//取设置值,如果应用程序名为空,这里将找第一个
CString INISetting::GetSetting(LPCTSTR szKey,LPCTSTR sDefValue,LPCTSTR szAppName)
{
	CString sKey;
	CString sValue;
	CString sAppName;
	PtrStruct *pMap;
	sKey = szKey;
	sAppName=szAppName;
	sKey.MakeUpper();
	sAppName.MakeUpper();

	BOOL bFind = FALSE;
	if (m_mapStringToMap.Lookup(sAppName,(void*&)pMap))
	{
		POSITION pp;
		pp = pMap->Data.GetStartPosition();
		while (pp)
		{
			int pos;
			KeyAndValue strTmp;
			pMap->Data.GetNextAssoc(pp, pos, strTmp);
			if (strTmp.sKey.CollateNoCase(sKey) == 0)
			{
				sValue = strTmp.sValue;
				bFind = TRUE;
				break;
			}
		}
	}

	if (!bFind)
	{
		sValue = sDefValue;
	}

	return sValue;
}
//特征访问函数
ProError CSDMdlAttrFeaSystemCheck::FeatureNameVisit(ProFeature* pFeature, ProError status,ProAppData app_data)
{
	status;
	ProName feaName;
	ProModelitemNameGet(pFeature, feaName);
	if (CString(feaName).CompareNoCase(L"no_name") == 0)
	{
		ProModelitemDefaultnameGet(pFeature, feaName);
	}

	// 处理规则值
	NameFeaVisitData &visitData=*(NameFeaVisitData*)app_data;

	CString strFeaNameCheckType;// 类型
	CString strCheckContent;// 具体规则内容
	CString strCheckedFeaName=feaName;// proName转换成cstring类型
	
	strFeaNameCheckType =visitData.strFeaNameCheckType;// 找到include or not include
	strCheckContent = visitData.strCheckContent;// 当前设定的规则值
	strFeaNameCheckType.MakeUpper();
	strCheckContent.MakeUpper();

	// 判断是否使用通配符
	if (strCheckContent.Find(L'*') >= 0)
	{
		if (CompareWildCard(strCheckContent, strCheckedFeaName))
		{
			return PRO_TK_USER_ABORT;
		}
	}
	else if (strCheckContent.CompareNoCase(strCheckedFeaName) == 0)
	{
		return PRO_TK_USER_ABORT;
	}

	return PRO_TK_NO_ERROR;
}
Example #19
0
long CKeyRegistry::SetHexKey(CString sString)
{
	sString.MakeUpper();
	
	long key = 0;

	for (int i = 0; i < sString.GetLength(); i++)
	{
		key |= HexDigit(sString[i]);

		if (i < 7)
			key <<= 4;
	}
	return key;
}
void CUncontrolledFiles::PushEnvironmentString(PTCHAR ptchString)
{
	CString strtmp;
	CString strExpanded;
	{
		AutoPTCHAR auptchExpanded(&strtmp, 4096);
		if (auptchExpanded.IsValid())
		{
			ExpandEnvironmentStrings(ptchString, auptchExpanded, auptchExpanded.GetBufferLength());
			strExpanded = auptchExpanded.GetPTCH();
			strExpanded.MakeUpper();
			m_UncotrolledFileList.push_back(strExpanded);
		}
	}
}
Example #21
0
//创建
//	-szDB:    库名,例如"HSRUN10"
//	-szTable: 表名,例如"XT_NEWCHKCONNECT"
bool CADO::CreateSPParamsAdo( CString szDB, CString szTable )
{
	//获取共享内存中的连接结构
	GetCNTptr( &m_CNT );
	if( NULL==m_CNT.pConn )
		return false;
	//直接转化成大写字符串
	szDB.MakeUpper();
	szTable.MakeUpper();

	//创建存储实例
	if( NULL == m_pObj )
	{
		m_pObj = new CStoreObj;
	}
	if( m_pObj )
	{
		if( ((CStoreObj*)m_pObj)->CreateStoreObj( m_CNT.pConn,szDB,szTable) )
			return true;
		delete m_pObj;
		m_pObj = NULL;
	}
	return false;
}
Example #22
0
//读取快捷方式的信息    
BOOL CFileSearch::ReadShortCut(LPTSTR linkName)   
{   
	::CoInitialize(NULL);   
	IShellLink *m_pIShellLink=NULL;   
	IPersistFile *m_pIPersistFile=NULL;   
	HRESULT hr=::CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER,IID_IShellLink,(LPVOID*)&m_pIShellLink);   
	if(hr==S_OK)   
	{   
		hr=m_pIShellLink->QueryInterface(IID_IPersistFile,(void **)&m_pIPersistFile); 

		if(hr==S_OK)   
		{   
			USES_CONVERSION;    
			m_pIPersistFile->Load(T2COLE(linkName),STGM_READWRITE);

			char m_strPath[MAX_PATH]={0};   
			m_pIShellLink->GetPath(m_strPath,MAX_PATH,NULL,SLGP_UNCPRIORITY); 

			CString temp = m_strPath;   
			temp.MakeUpper();   

			m_strFind.MakeUpper();

			if (strstr(temp.GetBuffer(),m_strFind.GetBuffer()))  //判断应用程序名
			{
				//AfxMessageBox(temp);

				if(m_pIShellLink) 
					m_pIShellLink->Release(); 

				if(m_pIPersistFile) 
					m_pIPersistFile->Release();  

				::CoUninitialize();   
				return TRUE;   
			}
		}   
	}   
  
	if(m_pIShellLink) 
		m_pIShellLink->Release(); 

	if(m_pIPersistFile) 
		m_pIPersistFile->Release();  

	::CoUninitialize();   
	return FALSE;   
}  
Example #23
0
PreviewMode CFilePreviewCtrl::DetectPreviewMode(LPCTSTR szFileName)
{
    PreviewMode mode = PREVIEW_HEX;
    CString sFileName;
    std::set<CString>::iterator it;
    std::set<CString> aTextFileExtensions;
    CString sExtension;

    sFileName = szFileName;

    if(CImage::IsImageFile(sFileName))
    {
        mode = PREVIEW_IMAGE;
        goto cleanup;
    }

    int backslash_pos = sFileName.ReverseFind('\\');
    if(backslash_pos>=0)
        sFileName = sFileName.Mid(backslash_pos+1);
    int dot_pos = sFileName.ReverseFind('.');
    if(dot_pos>0)
        sExtension = sFileName.Mid(dot_pos+1);
    sExtension.MakeUpper();

    aTextFileExtensions.insert(_T("TXT"));
    aTextFileExtensions.insert(_T("INI"));
    aTextFileExtensions.insert(_T("LOG"));
    aTextFileExtensions.insert(_T("XML"));
    aTextFileExtensions.insert(_T("HTM"));
    aTextFileExtensions.insert(_T("HTML"));
    aTextFileExtensions.insert(_T("JS"));
    aTextFileExtensions.insert(_T("C"));
    aTextFileExtensions.insert(_T("H"));
    aTextFileExtensions.insert(_T("CPP"));
    aTextFileExtensions.insert(_T("HPP"));

    it = aTextFileExtensions.find(sExtension);
    if(it!=aTextFileExtensions.end())
    {
        mode = PREVIEW_TEXT;
    }

cleanup:

    return mode;
}
Example #24
0
BOOL CMimicFile::CheckGrbValid(CString Grbiid)
{
	CString Grbtmp;

	Grbtmp = Grbiid.MakeUpper().Trim();
	if(Grbtmp.Left(2) != "GR")
		return FALSE;
	if(Grbtmp.GetLength() != 8)
		return FALSE;

	for(int i = 2; i < 8; i++)
	{
		if( Grbtmp.Mid(i, 1) < "0" || Grbtmp.Mid(i, 1) > "9" )
		{
			return(FALSE);
		}
	}

	return TRUE;
}
// ---------------------------------------------------------
//	名称: OnOk
//	功能: 开始下载网页
//	参数: 无
//	返回: 无
//	编写: 徐景周(jingzhou_xu@163.net)
//  组织: 未来工作室(Future Studio)
//	日期: 2002.1.8
// ---------------------------------------------------------
void CDownloadAddress::OnOk() 
{
	m_Address.GetWindowText(m_strAddress);

	if ("" == m_strAddress)
	{
		AfxMessageBox("\n 抱歉,下载网址不能为空! ");
		return ;
	}

	CString szHTTP	= m_strAddress;
	szHTTP	= szHTTP.Left(5);
	szHTTP.MakeUpper();

	// 增加一个合法的网址头
	if(_T("HTTP:") != szHTTP) 
		m_strAddress = _T("HTTP://") + m_strAddress;

	CDialog::OnOK();	// 关闭此对话框,必须加入,否则不能返回IDOK
}
Example #26
0
// MP3の選択:MP3コーデックが使用できない場合(Vista)のチェック
void CSettingPubTab::OnRdoMp3() 
{
	UpdateData(TRUE);	// DDX更新

	/// MP3コーデックを選択
	CString str = m_aryCodecName.GetAt(m_idxCodecName);
	str.MakeUpper();

	/// MP3フォーマットリストを更新
	int intCnt = m_oAcmMgr.GetFormatList(m_aryFormatName, &m_wfx);
	if (intCnt == 0 && str.Find(ACM_CODEC_MP3) >= 0) {
		//// FraunHoffer MP3コーデックが使用できない場合(Vista)
		CAudio *pAudio = CAudio::Instance();
		pAudio->MP3CodecRegistry();
	}

	UpdateData(FALSE);	// DDX更新

	/// 適用ボタンの有効化
	OnChgForm();
}
Example #27
0
uint32 CHtmlInputLogic::GetPictureNum(CString& strText)
{
	uint32 nCount = 0;

	int nPos = 0;
	CString strTemp = strText.MakeUpper();

	while(1)
	{
		int nTemp = strTemp.Find(L"<IMG", nPos);
		if (nTemp < 0)
		{
			break;
		}

		++nCount;
		nPos = nTemp + 1;
	}

	return nCount;
}
Example #28
0
CString CFilesHashDlg::ResultFind(CString strFile, CString strHash)
{
	CString strResult(MAINDLG_FIND_IN_RESULT);
	strResult.Append(_T("\r\n"));
	strResult.Append(HASHVALUE_STRING);
	strResult.Append(_T(" "));
	strResult.Append(strHash);
	strResult.Append(_T("\r\n\r\n"));
	strResult.Append(MAINDLG_RESULT);
	strResult.Append(_T("\r\n\r\n"));

	strHash.MakeUpper();
	strFile.MakeLower();

	size_t count = 0;
	CString strPathLower;
	ResultList::iterator itr = m_thrdData.resultList.begin();
	for(; itr != m_thrdData.resultList.end(); ++itr)
	{
		strPathLower = itr->strPath;
		strPathLower.MakeLower();
		if(strPathLower.Find(strFile) >= 0 && 
			(itr->strMD5.Find(strHash) >= 0 ||
			itr->strSHA1.Find(strHash) >= 0 ||
			itr->strSHA256.Find(strHash) >= 0 ||
			itr->strCRC32.Find(strHash) >= 0 ))
		{
			++count;

			AppendResult(*itr, strResult);
		}
	}

	if(count == 0)
		strResult.Append(MAINDLG_NORESULT);

	return strResult;
}
Example #29
0
// MP3コーデックの変更→フォーマットリスト更新
void CSettingPubTab::OnCmbCodec() 
{
	UpdateData(TRUE);	// DDX更新

	int i;

	/// MP3コーデックを選択
	CString str = m_aryCodecName.GetAt(m_idxCodecName);
	str.MakeUpper();
	if (str.Find(ACM_CODEC_MP3_LAME) >= 0) {
		m_oAcmMgr.FindDriver(CAcmMgr::WAV_MP3_LAME, str);
	} else {
		m_oAcmMgr.FindDriver(CAcmMgr::WAV_MP3, str);
	}

	/// MP3フォーマットリストを更新
	int intCnt = m_oAcmMgr.GetFormatList(m_aryFormatName, &m_wfx);
	if (intCnt == 0 && str.Find(ACM_CODEC_MP3) >= 0) {
		//// FraunHoffer MP3コーデックが使用できない場合(Vista)
		CAudio *pAudio = CAudio::Instance();
		pAudio->MP3CodecRegistry();
	}

	/// MP3フォーマットコンボボックスを更新
	CComboBox *pcmb = (CComboBox*)GetDlgItem(IDC_CMB_FORMAT);
	pcmb->ResetContent();
	for(i = 0; i < intCnt; i++) {
		pcmb->AddString(m_aryFormatName.GetAt(i));
	}
 	/// MP3フォーマットコンボボックスを選択
	m_idxFormatName = 0;

	UpdateData(FALSE);	// DDX更新

	/// 適用ボタンの有効化
	OnChgForm();
}
Example #30
0
//取所有值,键名都专为大写,返回个数
int INISetting::GetAllKeysAndValues(LPCTSTR szAppName,CStringArray & aKeys,CStringArray & aValues)
{
	POSITION ps;
	PtrStruct *pData;
	CString sAppName;
	CString sKey;
	CString sValue;

	aKeys.RemoveAll();
	aValues.RemoveAll();

	sAppName = szAppName;
	sAppName.MakeUpper();

	CStringArray sKTmp, sVTmp;
	if (m_mapStringToMap.Lookup(sAppName,(void*&)pData))
	{
		ps = pData->Data.GetStartPosition();
		while (ps)
		{
			int pos;
			KeyAndValue strTmp;
			pData->Data.GetNextAssoc(ps, pos, strTmp);
			sKTmp.Add(strTmp.sKey);
			sVTmp.Add(strTmp.sValue);
		}
	}

	for (int i = sKTmp.GetSize() - 1; i >= 0; i--)
	{
		aKeys.Add(sKTmp.GetAt(i));
		aValues.Add(sVTmp.GetAt(i));
	}

	return aKeys.GetSize();
}