Click here to Skip to main content
15,912,665 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to I create a Check List Box? Pin
monsieur_jj19-Jun-08 15:51
monsieur_jj19-Jun-08 15:51 
QuestionOle Db Consumer Pin
Donwangugi`9-Jun-08 10:02
Donwangugi`9-Jun-08 10:02 
AnswerRe: Ole Db Consumer Pin
Gene OK12-Jun-08 3:51
Gene OK12-Jun-08 3:51 
Questionhow to implement CStdioFile::WriteLine() with native C++ and STL? Pin
steven_wong4-Jun-08 14:20
steven_wong4-Jun-08 14:20 
AnswerRe: how to implement CStdioFile::WriteLine() with native C++ and STL? Pin
Jörgen Sigvardsson4-Jun-08 20:53
Jörgen Sigvardsson4-Jun-08 20:53 
GeneralRe: how to implement CStdioFile::WriteLine() with native C++ and STL? Pin
steven_wong5-Jun-08 1:07
steven_wong5-Jun-08 1:07 
Questionstd::find_if and std::equal_to Pin
Member 46952313-Jun-08 22:50
Member 46952313-Jun-08 22:50 
AnswerRe: std::find_if and std::equal_to Pin
Stephen Hewitt4-Jun-08 21:55
Stephen Hewitt4-Jun-08 21:55 
Something like this is the way I'd do it:

// VanillaConsole.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
 
class MyData
{
public:
	MyData(int id =0) : m_id(id) {};
 
	int id() const
	{
		return m_id;
	}
 
	// Functor to search by id.
	class IdEquals : public unary_function<MyData, bool>
	{
	public:
		IdEquals(int id) : m_id(id) {}

		bool operator()(const MyData &data) const
		{
			return data.id() == m_id;
		}
 
	private:
		int m_id;
	};
 
private:
	int m_id;
	// ... Other data here... //
};
 
int main()
{
	typedef vector<MyData> Coll_t;
	Coll_t data;
	data.push_back(MyData(1));
	data.push_back(MyData(3));
	data.push_back(MyData(5));
 
	Coll_t::const_iterator i = find_if(data.begin(), data.end(), MyData::IdEquals(2));
	if (i != data.end())
	{
		cout << "2 found." << endl;
	}
	else
	{
		cout << "2 NOT found!" << endl;
	}
 
	i = find_if(data.begin(), data.end(), MyData::IdEquals(3));
	if (i != data.end())
	{
		cout << "3 found." << endl;
	}
	else
	{
		cout << "3 NOT found!" << endl;
	}
 
	return 0;
}


Steve

AnswerRe: std::find_if and std::equal_to Pin
Stuart Dootson5-Jun-08 15:01
professionalStuart Dootson5-Jun-08 15:01 
AnswerRe: std::find_if and std::equal_to Pin
Michael Dunn12-Jun-08 14:54
sitebuilderMichael Dunn12-Jun-08 14:54 
GeneralRe: std::find_if and std::equal_to Pin
Stephen Hewitt12-Jun-08 18:16
Stephen Hewitt12-Jun-08 18:16 
GeneralRe: std::find_if and std::equal_to Pin
Member 469523115-Jun-08 23:19
Member 469523115-Jun-08 23:19 
QuestionHow to make the ActiveX control full transparent int word Pin
liuguang1-Jun-08 16:55
liuguang1-Jun-08 16:55 
AnswerRe: How to make the ActiveX control full transparent int word Pin
Ju@ncho4-Jul-08 4:28
Ju@ncho4-Jul-08 4:28 
GeneralRe: How to make the ActiveX control full transparent int word Pin
liuguang6-Jul-08 15:18
liuguang6-Jul-08 15:18 
QuestionMFC-STL Pin
Yokeldj29-May-08 0:41
Yokeldj29-May-08 0:41 
QuestionCompiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help. Pin
Arris7426-May-08 6:33
Arris7426-May-08 6:33 
QuestionMaking use of an STL reducer application Pin
malte de moll24-May-08 6:24
malte de moll24-May-08 6:24 
AnswerRe: Making use of an STL reducer application Pin
Stuart Dootson29-May-08 21:37
professionalStuart Dootson29-May-08 21:37 
QuestionUsing events of JScript in ATL COM DLL? Pin
ritz123422-May-08 0:30
ritz123422-May-08 0:30 
QuestionCheckbox and Listbox question Pin
monsieur_jj21-May-08 22:32
monsieur_jj21-May-08 22:32 
AnswerRe: Checkbox and Listbox question Pin
monsieur_jj22-May-08 16:24
monsieur_jj22-May-08 16:24 
GeneralRe: Checkbox and Listbox question Pin
Stuart Dootson22-May-08 22:22
professionalStuart Dootson22-May-08 22:22 
GeneralRe: Checkbox and Listbox question Pin
monsieur_jj25-May-08 16:39
monsieur_jj25-May-08 16:39 
GeneralRe: Checkbox and Listbox question Pin
Stuart Dootson26-May-08 12:30
professionalStuart Dootson26-May-08 12:30 

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.