Click here to Skip to main content
15,926,403 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Visual C++ 6.0 compiler Pin
Derek Waters7-Mar-02 16:27
Derek Waters7-Mar-02 16:27 
GeneralRe: Visual C++ 6.0 compiler Pin
7-Mar-02 16:31
suss7-Mar-02 16:31 
GeneralRe: Visual C++ 6.0 compiler Pin
Christian Graus7-Mar-02 16:44
protectorChristian Graus7-Mar-02 16:44 
GeneralRe: Visual C++ 6.0 compiler Pin
7-Mar-02 16:58
suss7-Mar-02 16:58 
GeneralRe: Visual C++ 6.0 compiler Pin
Christian Graus7-Mar-02 16:49
protectorChristian Graus7-Mar-02 16:49 
GeneralRe: Visual C++ 6.0 compiler Pin
Derek Waters7-Mar-02 16:53
Derek Waters7-Mar-02 16:53 
QuestionHow can I send a fax using visual c++ code? Does a demo project exist? Pin
DanYELL7-Mar-02 12:39
DanYELL7-Mar-02 12:39 
AnswerRe: How can I send a fax using visual c++ code? Does a demo project exist? Pin
Christian Graus7-Mar-02 12:52
protectorChristian Graus7-Mar-02 12:52 
GeneralRe: How can I send a fax using visual c++ code? Does a demo project exist? Pin
Sameer Maggon12-May-02 23:02
Sameer Maggon12-May-02 23:02 
GeneralRe: How can I send a fax using visual c++ code? Does a demo project exist? Pin
Christian Graus12-May-02 23:10
protectorChristian Graus12-May-02 23:10 
AnswerRe: How can I send a fax using visual c++ code? Does a demo project exist? Pin
Michael P Butler7-Mar-02 23:01
Michael P Butler7-Mar-02 23:01 
GeneralThread Synch Pin
Stephen Caldwell7-Mar-02 11:37
Stephen Caldwell7-Mar-02 11:37 
GeneralRe: Thread Synch Pin
Joaquín M López Muñoz7-Mar-02 11:41
Joaquín M López Muñoz7-Mar-02 11:41 
GeneralRe: Thread Synch Pin
Stephen Caldwell7-Mar-02 11:51
Stephen Caldwell7-Mar-02 11:51 
GeneralRe: Thread Synch Pin
Serge Krynine7-Mar-02 12:08
Serge Krynine7-Mar-02 12:08 
GeneralRe: Thread Synch Pin
Nemanja Trifunovic7-Mar-02 12:12
Nemanja Trifunovic7-Mar-02 12:12 
GeneralRe: Thread Synch Pin
Stephen Caldwell7-Mar-02 12:23
Stephen Caldwell7-Mar-02 12:23 
GeneralRe: Thread Synch Pin
markkuk7-Mar-02 19:47
markkuk7-Mar-02 19:47 
GeneralRe: Thread Synch Pin
Tim Smith7-Mar-02 12:23
Tim Smith7-Mar-02 12:23 
GeneralSending WM_KEYDOWN from other application Pin
Libor Matejka7-Mar-02 10:45
Libor Matejka7-Mar-02 10:45 
GeneralRe: Sending WM_KEYDOWN from other application Pin
Ravi Bhavnani7-Mar-02 11:02
professionalRavi Bhavnani7-Mar-02 11:02 
GeneralRe: Sending WM_KEYDOWN from other application Pin
Tim Deveaux7-Mar-02 11:14
Tim Deveaux7-Mar-02 11:14 
GeneralSearching Through Files Pin
Steven Gregg7-Mar-02 10:44
Steven Gregg7-Mar-02 10:44 
GeneralRe: Searching Through Files Pin
Todd Smith7-Mar-02 12:51
Todd Smith7-Mar-02 12:51 
This is what I use. Other than strlower it should work as is.

template <class InIt, class FwIt>
bool search_input(InIt begin, InIt end, FwIt find1, FwIt find2)
{
	FwIt findstart(find1);
	while (begin != end)
	{
		if (tolower(*begin) == tolower(*find1))
		{
			while (find1 != find2 && begin != end && tolower(*begin) == tolower(*find1))
			{
				++find1;
				++begin;				
			}
			if (find1 == find2)
			{
				return true;
			}
			find1 = findstart;
			continue;
		}
		++begin;
	} 
	return false;
}

bool FindInFile(const char* file, std::string str)
{
	std::ifstream In(file, std::ios::in|std::ios::binary);
	if (!In)
	{
		return false;
	}

	std::string s = str::strlower(std::string(str));

	while (search_input(std::istreambuf_iterator<char>(In), 
		   std::istreambuf_iterator<char>(), s.begin(), s.end()))
	{
		return true;
	}

	return false;
}



Todd Smith


CPUA 0x007 ... shaken not stirred



GeneralRe: Searching Through Files Pin
Tomasz Sowinski7-Mar-02 23:48
Tomasz Sowinski7-Mar-02 23:48 

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.