Click here to Skip to main content
15,884,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Use libpng? Pin
Hamid_RT3-Dec-07 19:37
Hamid_RT3-Dec-07 19:37 
GeneralMoveWindow() Pin
Oliver1233-Dec-07 16:25
Oliver1233-Dec-07 16:25 
GeneralRe: MoveWindow() Pin
bob169723-Dec-07 17:13
bob169723-Dec-07 17:13 
GeneralRe: MoveWindow() Pin
Hamid_RT3-Dec-07 19:36
Hamid_RT3-Dec-07 19:36 
GeneralRe: MoveWindow() Pin
David Crow4-Dec-07 7:29
David Crow4-Dec-07 7:29 
GeneralIn a vector: How to locate a certain element; then erase just that element Pin
Larry Mills Sr3-Dec-07 10:49
Larry Mills Sr3-Dec-07 10:49 
GeneralRe: In a vector: How to locate a certain element; then erase just that element Pin
Stephen Hewitt3-Dec-07 13:42
Stephen Hewitt3-Dec-07 13:42 
GeneralRe: In a vector: How to locate a certain element; then erase just that element Pin
Stephen Hewitt3-Dec-07 13:50
Stephen Hewitt3-Dec-07 13:50 
As for searching I'd:

1. Add an operator== for CMyTrailer:
class CMyTrailer
{
public:
	// Varables
	CString   m_csItem;
	CString   m_csMFG;
	CString   m_csID;
          
	CMyTrailer();
	~CMyTrailer();
};
 
inline bool operator==(const CMyTrailer &lhs, const CMyTrailer &rhs)
{
	return lhs.m_csID==rhs.m_csID;
}


2. Now search as follows:
vector<CMyTrailer>::iterator i = std::find(m_vTlr.begin(), m_vTlr.end(), CString("FindMe"));
if (i!=m_vTlr.end())
{
	// Found it!
}

The above code assumes you've included algorithm.

Steve

modified on Monday, December 03, 2007 10:06:57 PM

GeneralRe: In a vector: How to locate a certain element; then erase just that element [modified] Pin
Larry Mills Sr4-Dec-07 5:45
Larry Mills Sr4-Dec-07 5:45 
GeneralRe: In a vector: How to locate a certain element; then erase just that element Pin
David Crow4-Dec-07 7:33
David Crow4-Dec-07 7:33 
GeneralRe: In a vector: How to locate a certain element; then erase just that element Pin
Larry Mills Sr4-Dec-07 11:37
Larry Mills Sr4-Dec-07 11:37 
GeneralRe: In a vector: How to locate a certain element; then erase just that element Pin
Nelek4-Dec-07 21:28
protectorNelek4-Dec-07 21:28 
GeneralRe: In a vector: How to locate a certain element; then erase just that element Pin
Larry Mills Sr5-Dec-07 3:24
Larry Mills Sr5-Dec-07 3:24 
GeneralDialog box with changeable STATIC text and TITLE Pin
RomTibi3-Dec-07 9:12
RomTibi3-Dec-07 9:12 
GeneralRe: Dialog box with changeable STATIC text and TITLE Pin
Oliver1233-Dec-07 18:18
Oliver1233-Dec-07 18:18 
GeneralRe: Dialog box with changeable STATIC text and TITLE Pin
RomTibi4-Dec-07 8:56
RomTibi4-Dec-07 8:56 
GeneralRe: Dialog box with changeable STATIC text and TITLE Pin
Paresh Chitte3-Dec-07 18:26
Paresh Chitte3-Dec-07 18:26 
GeneralRe: Dialog box with changeable STATIC text and TITLE Pin
RomTibi4-Dec-07 8:57
RomTibi4-Dec-07 8:57 
GeneralDialog box with changeable STATIC text Pin
RomTibi3-Dec-07 9:09
RomTibi3-Dec-07 9:09 
QuestionRe: Dialog box with changeable STATIC text Pin
Mark Salsbery3-Dec-07 10:08
Mark Salsbery3-Dec-07 10:08 
GeneralRe: Dialog box with changeable STATIC text Pin
RomTibi4-Dec-07 8:57
RomTibi4-Dec-07 8:57 
GeneralRe: Dialog box with changeable STATIC text Pin
Hamid_RT3-Dec-07 19:31
Hamid_RT3-Dec-07 19:31 
GeneralRe: Dialog box with changeable STATIC text Pin
RomTibi4-Dec-07 8:58
RomTibi4-Dec-07 8:58 
GeneralRe: Dialog box with changeable STATIC text Pin
Hamid_RT4-Dec-07 18:22
Hamid_RT4-Dec-07 18:22 
GeneralRe: Dialog box with changeable STATIC text Pin
Nelek4-Dec-07 21:23
protectorNelek4-Dec-07 21:23 

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.