Click here to Skip to main content
15,915,869 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Questionunhandle exception(8000ffff) while acceing ocx methods Pin
Rajesh match18-Nov-05 21:10
Rajesh match18-Nov-05 21:10 
AnswerRe: unhandle exception(8000ffff) while acceing ocx methods Pin
Michael Dunn19-Nov-05 15:18
sitebuilderMichael Dunn19-Nov-05 15:18 
AnswerRe: unhandle exception(8000ffff) while acceing ocx methods Pin
JonEngle6-Dec-05 19:16
JonEngle6-Dec-05 19:16 
QuestionHow to access method of user define control from ATL Pin
rajesh_kapure16-Nov-05 3:54
rajesh_kapure16-Nov-05 3:54 
QuestionUsing ActiveX without container Pin
Ahsan Askare14-Nov-05 23:33
Ahsan Askare14-Nov-05 23:33 
QuestionHow do you know the duplicate key insertion in STL map Pin
sarath_babu13-Nov-05 20:23
sarath_babu13-Nov-05 20:23 
AnswerRe: How do you know the duplicate key insertion in STL map Pin
Jonas Larsson13-Nov-05 21:50
Jonas Larsson13-Nov-05 21:50 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
sarath_babu14-Nov-05 0:09
sarath_babu14-Nov-05 0:09 
hi ,
I have an code, in that code i want know when i will get a duplicate value since values are generated at runtime.
could you know the duplicate value by overloading < and == operators.

#include<iostream.h>
#include <algorithm>

class A
{
unsigned long la;
unsigned long lb;
unsigned long lc;
public:
A()
{
la=lb=lc=0;
}
A(unsigned long ln,unsigned long lm,unsigned long lo)
{
la=ln;
lb=lm;
lc=lo;
}
A(const A& objref)
{
la=objref.la ;
lb=objref.lb;
lc=objref.lc;
}
A& operator =(const A& objref)
{
if(this!=&objref)
{
la=objref.la;
lb=objref.lb;
lc=objref.lc;
}
return *this;
}

bool operator==(const A& objref) const
{
bool b=(((la==objref.la)&&(lb==objref.lb)&&(lc==objref.lc))?1Blush | :O );
return b;
}

/*
bool operator<(const A& objref) const
{
if((((la==objref.la)&&(lb==objref.lb)&&(lc==objref.lc))?1Blush | :O ))
{
cout<<"Attempting insert a duplicate value -"<<"("<<la<<","<<lb<<","<<lc<<")"<<" -="" "<<endl;
="" }
="" return="" la<objref.la=""
="" ||(!(objref.la<la)="" &&="" lb<objref.lb)
="" ||(!(objref.la<la)&&="" (!(objref.lb<lb))&&="" lc<objref.lc);
="" *="" bool="" operator="" !="(const" a&="" objref)="" const
="" {
="" if(((la="=objref.la)&&(lb==objref.lb)&&(lc==objref.lc))?1Blush | :O )
" 0;
="" 1;
="" unsigned="" long="" sum();
="" void="" displayvalues()="" cout<<"("<<la<<","<<lb<<","<<lc<<")"<<"="" ";
="" friend="" class="" asortcriterion;
};

unsigned="" a::sum="" ()
{
="" (la+lb+lc);
}


="" for="" function="" predicate
*="" operator()="" returns="" whether="" a="" person="" is="" less="" than="" another="" person
*=""

class="" asortcriterion=""
{
public:
="" (const="" p1,="" const="" p2)="" if((((p1.la="=p2.la)&&(p1.lb==p2.lb)&&(p1.lc" =="p2.lc))?1Blush | :O ))
" cout<<"attempting="" insert="" duplicate="" value="" -"<<"("<<p1.la<<","<<p1.lb<<","<<p1.lc<<")"<<"="" p1.la<p2.la="" ||(!(p2.la<p1.la)="" p1.lb<p2.lb)
="" ||(!(p2.la<p1.la)&&="" (!(p2.lb<p1.lb))&&="" p1.lc<p2.lc);
=""
};


="" maptest.cpp="" :="" defines="" the="" entry="" point="" console="" application.
=""


#include="" "stdafx.h"
#include="" "maptest.h"
#include<map="">
using namespace std;

typedef std::map Aptrmap;
int main(int argc, char* argv[])
{
A objOne(0,1,2);
A objTwo(0,1,2);
A objThree(0,1,1);
A objFour(3,4,0),objFive(4,4,5);

float *pfa,*pfb,*pfc,*pfd,*pfe;
pfa= new float(1.10);
pfb= new float(2.20);
pfc= new float(3.30);
pfd =new float(4.40);
pfe =new float(5.50);

Aptrmap objmap;
objmap.insert(std::make_pair(objFive,pfe));
// objmap[objFive]=pfe;
objmap.insert(std::make_pair(objOne,pfa));
objmap.insert(std::make_pair(objTwo,pfb));
objmap.insert(std::make_pair(objThree,pfc));
objmap.insert(std::make_pair(objFour,pfd));

float pf=9;
objmap[objThree]=&pf;

// print all element values
Aptrmap::iterator pos;
for (pos = objmap.begin(); pos != objmap.end(); ++pos)
{
(pos->first).DisplayValues();
cout <<*( pos->second )<<endl;
}
="" cout="" <<="" endl;
=""
="" aptrmap::const_iterator="" postwo="objmap.find(objThree);
" cout<<*(postwo-="">second)<<endl;

="" aptrmap::const_iterator="" postwo1="objmap.find(objFive);
" cout<<*(postwo1-="">second)<

GeneralRe: How do you know the duplicate key insertion in STL map Pin
Jonas Larsson14-Nov-05 1:50
Jonas Larsson14-Nov-05 1:50 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
Stuart Dootson15-Nov-05 6:53
professionalStuart Dootson15-Nov-05 6:53 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
Jörgen Sigvardsson15-Nov-05 9:59
Jörgen Sigvardsson15-Nov-05 9:59 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
Stuart Dootson15-Nov-05 19:54
professionalStuart Dootson15-Nov-05 19:54 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
Jörgen Sigvardsson15-Nov-05 21:14
Jörgen Sigvardsson15-Nov-05 21:14 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
Stuart Dootson15-Nov-05 21:24
professionalStuart Dootson15-Nov-05 21:24 
GeneralRe: How do you know the duplicate key insertion in STL map Pin
Tim Smith23-Nov-05 4:05
Tim Smith23-Nov-05 4:05 
QuestionCommand Line AND a window? Pin
micr0chip12-Nov-05 1:40
micr0chip12-Nov-05 1:40 
AnswerRe: Command Line AND a window? Pin
Michael Dunn13-Nov-05 12:54
sitebuilderMichael Dunn13-Nov-05 12:54 
GeneralRe: Command Line AND a window? Pin
micr0chip15-Nov-05 6:25
micr0chip15-Nov-05 6:25 
Questionupload binary file using webservices Pin
Liu Shuai8-Nov-05 15:58
Liu Shuai8-Nov-05 15:58 
QuestionHow to handle ctrl+c etc in Shell Extension Pin
Solidcore8-Nov-05 0:15
Solidcore8-Nov-05 0:15 
QuestionHow to create a Service using ATL Pin
snprani7-Nov-05 19:02
snprani7-Nov-05 19:02 
AnswerRe: How to create a Service using ATL Pin
G Haranadh7-Nov-05 19:49
G Haranadh7-Nov-05 19:49 
QuestionActivex Versioning Pin
omaycotte7-Nov-05 10:17
omaycotte7-Nov-05 10:17 
Questionadd page in property sheet Pin
Maddie from Dartford6-Nov-05 19:23
Maddie from Dartford6-Nov-05 19:23 
AnswerRe: add page in property sheet Pin
srinivasa rao dutta12-Nov-05 0:53
srinivasa rao dutta12-Nov-05 0:53 

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.