Click here to Skip to main content
15,921,959 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Disable the Enter button Pin
Rajesh R Subramanian28-May-07 0:17
professionalRajesh R Subramanian28-May-07 0:17 
GeneralRe: Disable the Enter button Pin
Anurag Gandhi28-May-07 0:01
professionalAnurag Gandhi28-May-07 0:01 
QuestionHow to Upload .doc (MS Word File ) in MySQL Database Using VC++ front end Pin
Y_Kaushik27-May-07 22:52
Y_Kaushik27-May-07 22:52 
AnswerRe: How to Upload .doc (MS Word File ) in MySQL Database Using VC++ front end Pin
S Douglas28-May-07 19:54
professionalS Douglas28-May-07 19:54 
Questionhelp please! Pin
ginjikun27-May-07 22:45
ginjikun27-May-07 22:45 
AnswerRe: help please! Pin
Y_Kaushik27-May-07 23:03
Y_Kaushik27-May-07 23:03 
GeneralRe: help please! Pin
ginjikun27-May-07 23:45
ginjikun27-May-07 23:45 
GeneralRe: help please! Pin
Stephen Hewitt28-May-07 17:35
Stephen Hewitt28-May-07 17:35 
Perhaps this will give you some ideas:
--------------------------------------

// Console.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <ostream>
#include <deque>
#include <set>
#include <iterator>

class CData
{
public:
CData(int priority, int group)
: priority_(priority)
, group_(group)
{}

// Define the sorting criteria.
friend bool operator<(const CData &l, const CData &r)
{
if (l.priority_<r.priority_)
{
return true;
}
else
{
return l.priority_==r.priority_ && l.group_<r.group_;
}
}

int priority_;
int group_;
};

// So we can output the data to the console.
template <typename CH, typename TR>
inline std::basic_ostream<CH, TR>& operator<<(std::basic_ostream<CH, TR> &os, const CData &d)
{
os << "Priority: " << d.priority_ << std::endl;
os << "Group: " << d.group_ << std::endl;
return os;
}

typedef std::set<CData> DataCollecton_t;

int main(int arvc, char* argv[])
{
// Populate the collection.
DataCollecton_t coll;
coll.insert(CData(3, 2));
coll.insert(CData(3, 3));
coll.insert(CData(2, 2));
coll.insert(CData(1, 1));
coll.insert(CData(2, 3));
coll.insert(CData(1, 2));
coll.insert(CData(2, 1));
coll.insert(CData(1, 3));
coll.insert(CData(3, 1));

// Print the results.
std::copy(coll.begin(), coll.end(), std::ostream_iterator<CData>(std::cout));

return 0;
}


Steve
GeneralRe: help please! Pin
ginjikun29-May-07 18:29
ginjikun29-May-07 18:29 
QuestionCreate uninstall program Pin
Md. Mazharul Islam Khan27-May-07 22:45
Md. Mazharul Islam Khan27-May-07 22:45 
AnswerHow to Create uninstall program??? Pin
Md. Mazharul Islam Khan27-May-07 23:25
Md. Mazharul Islam Khan27-May-07 23:25 
QuestionMulti threads to download http file---please help me! Pin
victording27-May-07 22:32
victording27-May-07 22:32 
QuestionCheck Numeric value Pin
garfield18527-May-07 22:30
garfield18527-May-07 22:30 
AnswerRe: Check Numeric value Pin
_AnsHUMAN_ 27-May-07 22:38
_AnsHUMAN_ 27-May-07 22:38 
AnswerRe: Check Numeric value Pin
Anurag Gandhi27-May-07 22:45
professionalAnurag Gandhi27-May-07 22:45 
AnswerRe: Check Numeric value Pin
garfield18527-May-07 22:57
garfield18527-May-07 22:57 
GeneralRe: Check Numeric value Pin
_AnsHUMAN_ 28-May-07 0:05
_AnsHUMAN_ 28-May-07 0:05 
AnswerRe: Check Numeric value Pin
Lane Yu27-May-07 23:57
Lane Yu27-May-07 23:57 
QuestionProblem in "multi thread to download http file",thanks! Pin
victording27-May-07 22:27
victording27-May-07 22:27 
Questionabout SendMessage Pin
mt_samiei27-May-07 22:07
mt_samiei27-May-07 22:07 
AnswerRe: about SendMessage Pin
CPallini27-May-07 22:51
mveCPallini27-May-07 22:51 
JokeRe: about SendMessage Pin
Rajesh R Subramanian28-May-07 1:08
professionalRajesh R Subramanian28-May-07 1:08 
GeneralRe: about SendMessage Pin
CPallini28-May-07 1:36
mveCPallini28-May-07 1:36 
JokeRe: about SendMessage Pin
Hamid_RT28-May-07 1:59
Hamid_RT28-May-07 1:59 
AnswerRe: about SendMessage Pin
nitin328-May-07 0:30
nitin328-May-07 0:30 

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.