Click here to Skip to main content
15,897,273 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to handle strings in ATL. Pin
Nemanja Trifunovic5-Mar-08 3:50
Nemanja Trifunovic5-Mar-08 3:50 
GeneralRe: How to handle strings in ATL. Pin
ThatsAlok5-Mar-08 4:55
ThatsAlok5-Mar-08 4:55 
GeneralWTL::CHyperLink and WM_CTLCOLORSTATIC Pin
siavan26-Feb-08 2:06
siavan26-Feb-08 2:06 
QuestionHow to implement IEnumString in ATL 3.0 Pin
MANISH RASTOGI25-Feb-08 1:16
MANISH RASTOGI25-Feb-08 1:16 
AnswerRe: How to implement IEnumString in ATL 3.0 Pin
Ernest Laurentin5-Mar-08 4:33
Ernest Laurentin5-Mar-08 4:33 
GeneralRe: How to implement IEnumString in ATL 3.0 Pin
MANISH RASTOGI7-Mar-08 17:50
MANISH RASTOGI7-Mar-08 17:50 
GeneralRe: How to implement IEnumString in ATL 3.0 Pin
Ernest Laurentin10-Mar-08 4:41
Ernest Laurentin10-Mar-08 4:41 
GeneralUsing find_if STL function [modified] Pin
ComplexLifeForm23-Feb-08 10:18
ComplexLifeForm23-Feb-08 10:18 
Hi,

I am trying to use find_if STL method for learning purpose. I have an array of structure as

struct NewPriceLookup
{
NewPriceLookup() : m_oldprice(0.0), m_newprice(0.0)
{}

NewPriceLookup(const double& oldp, const double& newp):
m_oldprice(oldp), m_newprice(newp)
{}

double m_oldprice;
double m_newprice;
};

NewPriceLookup npLookup [5] = {NewPriceLookup(10.0, 12.0),
NewPriceLookup(12.0, 14.5),
NewPriceLookup(15.0, 17.0),
NewPriceLookup(22.0, 26.0),
NewPriceLookup(30.0, 35.0) };

vector<NewPriceLookup> OldNewPriceTable(&npLookup[0], &npLookup(5));

template<typename T1, typename T2, typename T3>
struct NewPriceGrabber : public binary_function<T1, T2, T3>
{
result_type operator()(first_argument_type arg1, second_argument_type arg2)
{
return (arg1.m_oldprice == arg2);
}
};

and somewhere in the method GetNewPrices() I am trying to do the following
.....
.....
double oldprice = 15.0;
double newprice = find_if( OldNewPriceTable.begin(), OldNewPriceTable.end(),
bind2nd(NewPriceGrabber<NewPriceLookup, double, bool>(), oldprice));

When I compile this code, I am getting all sorts of errors like pointer_to_binary_function expects 2 argument 1 provided, cannot deduce template argument etc...

Can someone please help me in getting this piece of code right?

Thanks in advance.
Confused | :confused: Confused | :confused:

<div class="ForumMod">modified on Sunday, February 24, 2008 12:42 PM</div>
GeneralRe: Using find_if STL function Pin
Stuart Dootson24-Feb-08 20:57
professionalStuart Dootson24-Feb-08 20:57 
GeneralRe: Using find_if STL function Pin
Stuart Dootson24-Feb-08 21:10
professionalStuart Dootson24-Feb-08 21:10 
GeneralRe: Using find_if STL function Pin
ComplexLifeForm25-Feb-08 0:57
ComplexLifeForm25-Feb-08 0:57 
GeneralRe: Using find_if STL function Pin
Stuart Dootson25-Feb-08 3:02
professionalStuart Dootson25-Feb-08 3:02 
GeneralRe: Using find_if STL function Pin
ComplexLifeForm25-Feb-08 18:22
ComplexLifeForm25-Feb-08 18:22 
GeneralRe: Using find_if STL function Pin
Johann Gerell14-May-08 21:54
Johann Gerell14-May-08 21:54 
GeneralATL and javascript Pin
whizdom16-Feb-08 21:35
whizdom16-Feb-08 21:35 
GeneralRe: ATL and javascript Pin
Nathan Holt at EMOM18-Feb-08 11:48
Nathan Holt at EMOM18-Feb-08 11:48 
GeneralRe: ATL and javascript Pin
whizdom22-Feb-08 7:43
whizdom22-Feb-08 7:43 
QuestionPlease enlighten me on STL iterators and CriticalSection locking Pin
Kosta Cherry13-Feb-08 21:15
Kosta Cherry13-Feb-08 21:15 
GeneralRe: Please enlighten me on STL iterators and CriticalSection locking Pin
Andy Moore14-Feb-08 6:11
Andy Moore14-Feb-08 6:11 
GeneralRe: Please enlighten me on STL iterators and CriticalSection locking Pin
Kosta Cherry14-Feb-08 11:49
Kosta Cherry14-Feb-08 11:49 
GeneralUsing an activex control in an ATL project Pin
zon_cpp11-Feb-08 20:33
zon_cpp11-Feb-08 20:33 
GeneralRe: Using an activex control in an ATL project Pin
Stuart Dootson11-Feb-08 23:38
professionalStuart Dootson11-Feb-08 23:38 
GeneralATL: IDispEvent*Impl for n instances [modified] Pin
wickdom8-Feb-08 3:59
wickdom8-Feb-08 3:59 
GeneralRe: ATL: IDispEvent*Impl for n instances Pin
Stuart Dootson8-Feb-08 8:52
professionalStuart Dootson8-Feb-08 8:52 
GeneralRe: ATL: IDispEvent*Impl for n instances Pin
wickdom8-Feb-08 12:03
wickdom8-Feb-08 12:03 

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.