Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hide a window from Taskbar Pin
Nibu babu thomas24-May-07 18:44
Nibu babu thomas24-May-07 18:44 
AnswerRe: Hide a window from Taskbar Pin
swarup24-May-07 22:34
swarup24-May-07 22:34 
GeneralRe: Hide a window from Taskbar Pin
Perspx25-May-07 5:29
Perspx25-May-07 5:29 
Questionread an parse html page using VC++ Pin
swarup24-May-07 8:18
swarup24-May-07 8:18 
QuestionRe: read an parse html page using VC++ Pin
David Crow24-May-07 8:39
David Crow24-May-07 8:39 
AnswerRe: read an parse html page using VC++ Pin
Hamid_RT24-May-07 11:02
Hamid_RT24-May-07 11:02 
AnswerRe: read an parse html page using VC++ Pin
swarup24-May-07 22:32
swarup24-May-07 22:32 
QuestionDifferent results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 8:03
Immunity1824-May-07 8:03 
Hi i have create a fuction to find how many words (str2) exist in line

int CInfoRecoverDlg::Compare( CString line , CString str2)
{
	int nCount = 0;
	int index=0;
	for (int i = 0 ; i < line.GetLength() ; i++)
	{
		index=line.Find(str2,index);
		if( index!= -1 )
		{
			if( !isalpha(line.GetAt(index-1)) && !isalpha(line.GetAt(index+ str2.GetLength())))
			{
				nCount++;
				index++;
			}
		}
		else
		return nCount;
	}
	return nCount ;
}


When i compare 2 CString that i have initialize and give value throught my code everything work nice
like here
void CInfoRecoverDlg::OnButton1() 
{
	CString str1;
	CString str = "yes";
	CString line = "yes i said yes, yes yes ";
	int nCount;

	nCount = Compare( line , str);
	str1.Format(_T("%d"), nCount);
	AfxMessageBox(str1);
} 


but when i compare 1 str (User give it throught application UI) with 1 line
(it get it from a file) things dont go well Frown | :(
<code>		CArray<CString , CString> RArray;
		CString FilePathName;
		CString LineRead ;
		CString str7;
		int ntimes=0;
		const int sz =100;
		char buf[sz];
		CString sl , slsl;
		sl = "\\" ;
			FilePathName = m_FolderName + FArray.GetAt(0);
			m_List.AddString(FilePathName);
			ifstream FileText(FilePathName);
			while(FileText.get(buf,sz))
			{
				FileText.get();
				LineRead = (LPCSTR) buf;
	
				for ( int m = 0 ; m <WArray.GetSize() ; m++)
				{
					str7 = WArray.GetAt(m);
					ntimes = ntimes + Compare(LineRead , str7);	
				}
			}


			FileText.close();			
			CString str13;
			str13.Format(_T("%d"),ntimes);
			AfxMessageBox(str13);</code> 

QuestionRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow24-May-07 8:33
David Crow24-May-07 8:33 
AnswerRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 8:36
Immunity1824-May-07 8:36 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow24-May-07 8:42
David Crow24-May-07 8:42 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 8:58
Immunity1824-May-07 8:58 
QuestionRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow24-May-07 10:08
David Crow24-May-07 10:08 
AnswerRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 13:12
Immunity1824-May-07 13:12 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow25-May-07 2:40
David Crow25-May-07 2:40 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1825-May-07 2:44
Immunity1825-May-07 2:44 
QuestionRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow25-May-07 2:56
David Crow25-May-07 2:56 
AnswerRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1825-May-07 3:17
Immunity1825-May-07 3:17 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow25-May-07 3:23
David Crow25-May-07 3:23 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1825-May-07 3:30
Immunity1825-May-07 3:30 
GeneralRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 9:02
Immunity1824-May-07 9:02 
QuestionRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow24-May-07 9:51
David Crow24-May-07 9:51 
AnswerRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 9:53
Immunity1824-May-07 9:53 
QuestionRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
David Crow24-May-07 10:01
David Crow24-May-07 10:01 
AnswerRe: Different results when , compare 2 strings and 1 str with 1 str from file Pin
Immunity1824-May-07 10:04
Immunity1824-May-07 10:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.