Click here to Skip to main content
15,918,889 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionCapturing IE events with using RBDESKBAND Pin
skumar120921-Aug-08 19:45
skumar120921-Aug-08 19:45 
Questionunique problem Pin
s196675m10-Aug-08 8:10
s196675m10-Aug-08 8:10 
AnswerRe: unique problem Pin
s196675m12-Aug-08 18:34
s196675m12-Aug-08 18:34 
AnswerRe: unique problem Pin
Stuart Dootson12-Aug-08 21:38
professionalStuart Dootson12-Aug-08 21:38 
GeneralRe: unique problem Pin
s196675m13-Aug-08 6:48
s196675m13-Aug-08 6:48 
GeneralRe: unique problem Pin
Stuart Dootson13-Aug-08 9:38
professionalStuart Dootson13-Aug-08 9:38 
GeneralRe: unique problem Pin
s196675m13-Aug-08 18:07
s196675m13-Aug-08 18:07 
GeneralRe: unique problem Pin
Stephen Hewitt19-Aug-08 14:58
Stephen Hewitt19-Aug-08 14:58 
The definition of your functor is wrong. You have:
Stuart Dootson wrote:
struct Finder : std::unary_function<bool, int>


It should read:
struct Finder : std::unary_function<int, bool>

Here's the definition of std::unary_function from <functional>:
// TEMPLATE STRUCT unary_function
template<class _A, class _R>
	struct unary_function {
	typedef _A argument_type;
	typedef _R result_type;
	};


The result type comes second, not first (which I've always thought was strange).
Also, you should be #includeing <functional> for std::unary_function, as things stand you seem to be relying on some other include file including it indirectly.

And finally, this technique is not very efficient. Try something like this:
// VanillaConsole.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
 
void main()
{
	using namespace std;
 
	// Create a vector and fill it with data.
	typedef vector<int> data_t;
	data_t data;
	data.push_back(1);
	data.push_back(3);
	data.push_back(2);
	data.push_back(1);
	data.push_back(5);
	data.push_back(1);
 
	// Show the user the contents before messing with it.
	cout << "Contents before:" << endl;
	copy(data.begin(), data.end(), ostream_iterator<int>(cout, " "));
	cout << endl << endl;
 
	// Remove the duplicates.
	sort(data.begin(), data.end());
	data_t::iterator new_end = unique(data.begin(), data.end());
 
	// Show the user the contents with duplicates removed (and sorted).
	cout < "Contents after:" < endl;
	copy(data.begin(), new_end, ostream_iterator<int>(cout, " "));
	cout << endl << endl;
}


Steve

GeneralRe: unique problem Pin
Stuart Dootson19-Aug-08 19:39
professionalStuart Dootson19-Aug-08 19:39 
GeneralRe: unique problem Pin
Stephen Hewitt19-Aug-08 19:43
Stephen Hewitt19-Aug-08 19:43 
AnswerRe: unique problem Pin
Stephen Hewitt19-Aug-08 14:59
Stephen Hewitt19-Aug-08 14:59 
QuestionAccess Vector Objects by ID Pin
Alex H 19838-Aug-08 23:04
Alex H 19838-Aug-08 23:04 
AnswerRe: Access Vector Objects by ID Pin
Stuart Dootson9-Aug-08 13:27
professionalStuart Dootson9-Aug-08 13:27 
QuestionATL OLE document container problem Pin
Member 30621765-Aug-08 21:55
Member 30621765-Aug-08 21:55 
QuestionComboBox With ActiveX Control Pin
Dabara27-Jul-08 20:07
Dabara27-Jul-08 20:07 
QuestionUnable to retrieve data from safe array Pin
Debasis1021-Jul-08 1:12
Debasis1021-Jul-08 1:12 
AnswerRe: Unable to retrieve data from safe array Pin
Stuart Dootson23-Jul-08 11:25
professionalStuart Dootson23-Jul-08 11:25 
Questionhow to Registering namespace handlers for HTTP and HTTPS protocols within the Internet Explorer process ? Pin
ftbk20-Jul-08 23:02
ftbk20-Jul-08 23:02 
AnswerRe: how to Registering namespace handlers for HTTP and HTTPS protocols within the Internet Explorer process ? Pin
Stephen Hewitt24-Jul-08 20:44
Stephen Hewitt24-Jul-08 20:44 
Questionhow to capture go event of internet explorer in vc++6 Pin
skumar120920-Jul-08 21:40
skumar120920-Jul-08 21:40 
QuestionCompilatio error : cannot convert from char to LPWSTR Pin
V K 220-Jul-08 19:16
V K 220-Jul-08 19:16 
AnswerRe: Compilatio error : cannot convert from char to LPWSTR Pin
Stuart Dootson20-Jul-08 21:47
professionalStuart Dootson20-Jul-08 21:47 
QuestionPRJ0019 error when performing a registration Pin
chatko17-Jul-08 3:57
chatko17-Jul-08 3:57 
QuestionHelp me Pin
Amit Battan Ror17-Jul-08 3:47
Amit Battan Ror17-Jul-08 3:47 
QuestionInitialization for OE/ Windows Mail Addin Pin
dolly16-Jul-08 0:14
dolly16-Jul-08 0:14 

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.