Click here to Skip to main content
16,015,166 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to use ActiveX controls in WTL? Pin
Ernesto D.16-Apr-03 15:36
Ernesto D.16-Apr-03 15:36 
GeneralInterface not showing in COM+ Pin
Le centriste14-Apr-03 5:18
Le centriste14-Apr-03 5:18 
GeneralRe: Interface not showing in COM+ Pin
Brian Shifrin15-Apr-03 1:54
Brian Shifrin15-Apr-03 1:54 
GeneralRe: Interface not showing in COM+ Pin
Le centriste15-Apr-03 8:25
Le centriste15-Apr-03 8:25 
GeneralConverting strings. Pin
Martin Marvinski12-Apr-03 11:14
Martin Marvinski12-Apr-03 11:14 
GeneralRe: Converting strings. Pin
ian mariano13-Apr-03 12:21
ian mariano13-Apr-03 12:21 
GeneralI can't Insert a ATL object when using New ATL Object?(It is not about tech, just for help!) Pin
white jungle11-Apr-03 16:33
white jungle11-Apr-03 16:33 
Generalostream_iterator error Pin
Kevin McFarlane11-Apr-03 5:26
Kevin McFarlane11-Apr-03 5:26 
Why does ostream_iterator not work for the second scoped code block in main below?

In VC6 you get an error something like:

"d:\program files\microsoft visual studio\vc98\include\iterator(203) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'const struct std::pair<int,int>' (or there is no acceptable conversion)"

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct MyClass
{
    MyClass(int f, int s)
        : first(f), second(s) {}
    int first;
    int second;
};

ostream& operator<<(ostream& stream, const MyClass& m)
{
	return stream << "First: " << m.first << ", Second: " << m.second;
}

typedef pair<int, int> MyClassPair;

ostream& operator<<(ostream& stream, const MyClassPair& m)
{
	return stream << "First: " << m.first << ", Second: " << m.second;
}

int main(int argc, char* argv[])
{
    // Use ostream_iterator with MyClass (works)
    {
        vector<MyClass> coll;

        for (int i = 1; i <= 10; i++)
        {
            MyClass m(i, i);
            coll.push_back(m);
        }
    
        copy(coll.begin(), coll.end(),   
             ostream_iterator<MyClass>(cout,"\n"));
    }
    
    // Use ostream_iterator with MyClassPair (does not compile)
    {
        vector<MyClassPair> coll;

        for (int i = 1; i <= 10; i++)
        {
            MyClassPair m(i, i);
            coll.push_back(m);
        }
    
        copy(coll.begin(), coll.end(),           
             ostream_iterator<MyClassPair>(cout,"\n"));
    }

    return 0;
}


Kevin
GeneralRe: ostream_iterator error Pin
Joaquín M López Muñoz11-Apr-03 10:13
Joaquín M López Muñoz11-Apr-03 10:13 
GeneralRe: ostream_iterator error Pin
Kevin McFarlane12-Apr-03 7:56
Kevin McFarlane12-Apr-03 7:56 
GeneralRe: ostream_iterator error Pin
Joaquín M López Muñoz11-Apr-03 10:17
Joaquín M López Muñoz11-Apr-03 10:17 
GeneralMedia Player Pin
Prog Mmer10-Apr-03 22:14
Prog Mmer10-Apr-03 22:14 
GeneralATL Server Web Services arrays and size_is Pin
scatter10-Apr-03 16:16
scatter10-Apr-03 16:16 
GeneralRe: ATL Server Web Services arrays and size_is Pin
Vi210-Apr-03 16:58
Vi210-Apr-03 16:58 
GeneralWTL: Reflect notifications to a control Pin
Ernesto D.9-Apr-03 15:08
Ernesto D.9-Apr-03 15:08 
GeneralRe: WTL: Reflect notifications to a control Pin
Michael Dunn9-Apr-03 19:06
sitebuilderMichael Dunn9-Apr-03 19:06 
GeneralRe: WTL: Reflect notifications to a control Pin
Ernesto D.9-Apr-03 19:53
Ernesto D.9-Apr-03 19:53 
QuestionMicrosoft Web Browser Object into DialogBox, without MFC? Pin
Adrian Bacaianu8-Apr-03 20:18
Adrian Bacaianu8-Apr-03 20:18 
GeneralSys Tray Icon disappears after Explorer reload Pin
MrGlover8-Apr-03 15:53
MrGlover8-Apr-03 15:53 
GeneralRe: Sys Tray Icon disappears after Explorer reload Pin
Brian Shifrin9-Apr-03 2:08
Brian Shifrin9-Apr-03 2:08 
Generalbeginner stl basic_string question Pin
mweiss8-Apr-03 9:12
mweiss8-Apr-03 9:12 
GeneralRe: beginner stl basic_string question Pin
Joaquín M López Muñoz8-Apr-03 9:39
Joaquín M López Muñoz8-Apr-03 9:39 
GeneralRe: beginner stl basic_string question Pin
mweiss8-Apr-03 9:50
mweiss8-Apr-03 9:50 
GeneralRe: beginner stl basic_string question Pin
Joaquín M López Muñoz8-Apr-03 9:56
Joaquín M López Muñoz8-Apr-03 9:56 
GeneralRe: beginner stl basic_string question Pin
mweiss8-Apr-03 10:17
mweiss8-Apr-03 10:17 

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.