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

C / C++ / MFC

 
GeneralRe: Issue with GetProcAddress Pin
A T I F9-Dec-04 18:35
A T I F9-Dec-04 18:35 
GeneralRe: Issue with GetProcAddress Pin
Daniel Gow11-Dec-04 13:04
Daniel Gow11-Dec-04 13:04 
QuestionNewbie Ques: How to get all Files and Directorys in a Directory? Pin
RedDragon2k8-Dec-04 5:28
RedDragon2k8-Dec-04 5:28 
AnswerRe: Newbie Ques: How to get all Files and Directorys in a Directory? Pin
BlackDice8-Dec-04 5:55
BlackDice8-Dec-04 5:55 
AnswerRe: Newbie Ques: How to get all Files and Directorys in a Directory? Pin
alex.barylski8-Dec-04 11:45
alex.barylski8-Dec-04 11:45 
QuestionHow to change SW_SHOWDEFAULT Pin
mcgahanfl8-Dec-04 4:50
mcgahanfl8-Dec-04 4:50 
AnswerRe: How to change SW_SHOWDEFAULT Pin
David Crow8-Dec-04 5:09
David Crow8-Dec-04 5:09 
General'Find' algorithm for vector using pointer to class object Pin
BlackDice8-Dec-04 4:06
BlackDice8-Dec-04 4:06 
I have a class called 'CWatchedWindow', and a vector container in my dialog class to hold pointers to CWatchedWindow objects.

I'm trying to use the find algorithm on the vector for a new object. The determining factor for one CWatchedWindow object to be equal to another is the string it holds, (m_strName). The operator== works in a simple if() statement, but it won't call any of the overloaded functions for operator== when I use the find algorithm using a pointer to an object of type CWatchedWindow. And I can't use it by de-referencing the pointer, because the template won't recognize it. Here's my class definition:

class CWatchedWindow
{
public:
	unsigned long	m_nSeconds;
	CString			m_strName;
	COleDateTime	m_lastTime;
	CWatchedWindow()
	{
		m_lastTime = COleDateTime::GetCurrentTime();
		m_nSeconds = 0;
	}
	bool operator== (const CWatchedWindow& sWord )   
	{ 
		return m_strName.CompareNoCase(sWord.m_strName) == 0;
	}
	bool operator== (const CWatchedWindow sWord )   
	{ 
		return m_strName.CompareNoCase(sWord.m_strName) == 0;
	}
	bool operator== (CWatchedWindow* pWord )   
	{ 
		return m_strName.CompareNoCase(pWord->m_strName) == 0;
	}
    bool operator== (const  CString& sWord )   
	{ 
		return m_strName.CompareNoCase(sWord) == 0;
	}
};


and here's the call to find:

CWatchedWindow win;
			win.m_strName = m_strLastWindowCaption;

			CWatchedWindow* pWin = &win;

			vector<CWatchedWindow*>::iterator  findIter;
            findIter = find(vecWindows.begin(),vecWindows.end(),pWin);


My articles

www.stillwaterexpress.com

BlackDice
GeneralRe: 'Find' algorithm for vector using pointer to class object Pin
Jack Puppy8-Dec-04 15:01
Jack Puppy8-Dec-04 15:01 
GeneralRe: 'Find' algorithm for vector using pointer to class object Pin
BlackDice9-Dec-04 2:42
BlackDice9-Dec-04 2:42 
GeneralRe: 'Find' algorithm for vector using pointer to class object Pin
Jack Puppy9-Dec-04 13:46
Jack Puppy9-Dec-04 13:46 
GeneralCListCtrl and Ado RecordSet Pin
shiraztk8-Dec-04 2:40
shiraztk8-Dec-04 2:40 
GeneralRe: CListCtrl and Ado RecordSet Pin
David Crow8-Dec-04 2:45
David Crow8-Dec-04 2:45 
GeneralRe: CListCtrl and Ado RecordSet Pin
shiraztk8-Dec-04 3:02
shiraztk8-Dec-04 3:02 
GeneralRe: CListCtrl and Ado RecordSet Pin
David Crow8-Dec-04 3:29
David Crow8-Dec-04 3:29 
GeneralNTGraph2D and VC++ .NET Pin
doneirik8-Dec-04 2:32
doneirik8-Dec-04 2:32 
QuestionHow to retrieve a VCProject object? Pin
Franz Klein8-Dec-04 2:17
Franz Klein8-Dec-04 2:17 
QuestionHow to convert BD_ADDR to BT_ADDR? Pin
eli150219798-Dec-04 1:20
eli150219798-Dec-04 1:20 
Questionusing ipconfig....help required??? Pin
shkhan8-Dec-04 0:43
shkhan8-Dec-04 0:43 
QuestionHow to copy files to another computer using Window XP by programming? Pin
dungle308-Dec-04 0:40
dungle308-Dec-04 0:40 
AnswerRe: How to copy files to another computer using Window XP by programming? Pin
David Crow8-Dec-04 2:38
David Crow8-Dec-04 2:38 
GeneralRe: How to copy files to another computer using Window XP by programming? Pin
dungle308-Dec-04 15:08
dungle308-Dec-04 15:08 
GeneralRe: How to copy files to another computer using Window XP by programming? Pin
David Crow9-Dec-04 2:31
David Crow9-Dec-04 2:31 
QuestionHow to minimize the window? Pin
ting6688-Dec-04 0:30
ting6688-Dec-04 0:30 
AnswerRe: How to minimize the window? Pin
ThatsAlok8-Dec-04 1:29
ThatsAlok8-Dec-04 1:29 

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.