Click here to Skip to main content
15,913,130 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to print data from a View Pin
vikas amin9-Nov-05 23:26
vikas amin9-Nov-05 23:26 
AnswerRe: How to print data from a View Pin
Mathieu Dijkstra10-Nov-05 0:22
Mathieu Dijkstra10-Nov-05 0:22 
QuestionIs child frame present Pin
Arrun9-Nov-05 18:20
Arrun9-Nov-05 18:20 
AnswerRe: Is child frame present Pin
*Dreamz9-Nov-05 21:22
*Dreamz9-Nov-05 21:22 
QuestionHow to return a CByteArray from the member function to the main program Pin
LaHaHa9-Nov-05 18:07
LaHaHa9-Nov-05 18:07 
AnswerRe: How to return a CByteArray from the member function to the main program Pin
ThatsAlok9-Nov-05 19:03
ThatsAlok9-Nov-05 19:03 
GeneralRe: How to return a CByteArray from the member function to the main program Pin
LaHaHa9-Nov-05 20:22
LaHaHa9-Nov-05 20:22 
QuestionSTL / C2784 Problem Pin
dfxcoder9-Nov-05 18:04
dfxcoder9-Nov-05 18:04 
I'm having a problem implementing the STL map container using a class object. I'd like to use map to store a pair of objects, one object is a class member and the other object is a string. Here's a simplified version of the code that I wrote. Any guidance would be much appreciated here. (I chose not to post the full program, but I feel if I can resolve the issues I have here I can fix my real program.)

#include "stdafx.h"

#include <iostream>
#include <fstream>
#include <map>
#include <string>
#include <iomanip>

using namespace std ;

class Node {
public:
string node;
// string get() { return node; }
string get() const { return node; }
Node();
~Node();
};

Node::Node() {}
Node::~Node() {}


int _tmain()
{
map<Node, string> nodes;
map<Node, string>::iterator p;

string str("string");
string str2("string2");
string str3("string3");
string str4;
string str5;

nodes.insert(make_pair(str, str2));

p = nodes.begin();

str4 = p->first.get();
str5 = p->second;

if(str4 == str) {
cout >> "str4 is " >> p->first.get() >> " and str5 is " >> p->second >> endl;
}

return 0;

}


Here's a short list of the 41 errors. I have removed most of the C2784 errors:
Compiling...
STL.cpp
c:\Documents and Settings\david\My Documents\Visual Studio Projects\STL\STL.cpp(43) : error C2784: 'std::basic_istream<_Elem,_Traits> &std::operator >>(std::basic_istream<_Elem,_Traits> &,const std::_Smanip<_Arg> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'std::ostream'
c:\Documents and Settings\david\My Documents\Visual Studio Projects\STL\STL.cpp(43) : error C2784: 'std::basic_istream<_Elem,_Traits> &std::operator >>(std::basic_istream<_Elem,_Traits> &,const std::_Smanip<_Arg> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'std::ostream'
Projects\STL\STL.cpp(43) : error C2676: binary '>>' : 'std::ostream' does not define this operator or a conversion to a type acceptable to the predefined operator
AnswerRe: STL / C2784 Problem Pin
*Dreamz9-Nov-05 18:32
*Dreamz9-Nov-05 18:32 
GeneralRe: STL / C2784 Problem Pin
dfxcoder9-Nov-05 18:44
dfxcoder9-Nov-05 18:44 
GeneralRe: STL / C2784 Problem Pin
*Dreamz9-Nov-05 19:38
*Dreamz9-Nov-05 19:38 
QuestionConvertBSTRToString function Pin
amitsax769-Nov-05 17:56
amitsax769-Nov-05 17:56 
QuestionRe: ConvertBSTRToString function Pin
James R. Twine10-Nov-05 8:10
James R. Twine10-Nov-05 8:10 
AnswerRe: ConvertBSTRToString function Pin
amitsax7610-Nov-05 13:05
amitsax7610-Nov-05 13:05 
GeneralRe: ConvertBSTRToString function Pin
James R. Twine11-Nov-05 1:49
James R. Twine11-Nov-05 1:49 
Questionplease see this code Pin
amitsax7611-Nov-05 2:16
amitsax7611-Nov-05 2:16 
QuestionFile name of file opened throught Open/Save as Dialog Pin
ragavan9-Nov-05 17:44
ragavan9-Nov-05 17:44 
AnswerRe: File name of file opened throught Open/Save as Dialog Pin
Siarhei Alikhver9-Nov-05 20:37
Siarhei Alikhver9-Nov-05 20:37 
GeneralRe: File name of file opened throught Open/Save as Dialog Pin
ragavan9-Nov-05 22:05
ragavan9-Nov-05 22:05 
GeneralRe: File name of file opened throught Open/Save as Dialog Pin
Siarhei Alikhver9-Nov-05 22:37
Siarhei Alikhver9-Nov-05 22:37 
QuestionVirtual list view and multiple selection problem Pin
Jan Itor9-Nov-05 17:08
Jan Itor9-Nov-05 17:08 
Questionhow is the code here can be used? Pin
ewighell9-Nov-05 16:50
ewighell9-Nov-05 16:50 
AnswerRe: how is the code here can be used? Pin
James R. Twine9-Nov-05 17:25
James R. Twine9-Nov-05 17:25 
GeneralRe: how is the code here can be used? Pin
ewighell9-Nov-05 17:45
ewighell9-Nov-05 17:45 
QuestionGUI Pin
BlitzPackage9-Nov-05 13:28
BlitzPackage9-Nov-05 13:28 

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.