Click here to Skip to main content
15,891,033 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: DIID_DWebBrowserEvents2 for dwebbrowserevent2, and ??? for IHTMLImgEvents2 Pin
tkarven23-Feb-05 7:45
tkarven23-Feb-05 7:45 
GeneralRe: DIID_DWebBrowserEvents2 for dwebbrowserevent2, and ??? for IHTMLImgEvents2 Pin
ThatsAlok23-Feb-05 19:00
ThatsAlok23-Feb-05 19:00 
GeneralRe: DIID_DWebBrowserEvents2 for dwebbrowserevent2, and ??? for IHTMLImgEvents2 Pin
tkarven23-Feb-05 20:27
tkarven23-Feb-05 20:27 
GeneralPostPaint in WTL::CEdit Pin
blueluna22-Feb-05 4:10
blueluna22-Feb-05 4:10 
GeneralRe: PostPaint in WTL::CEdit Pin
Michael Dunn22-Feb-05 7:42
sitebuilderMichael Dunn22-Feb-05 7:42 
Questionfor_each calls copy ctor on functor? Pin
Malcolm Smart21-Feb-05 22:56
Malcolm Smart21-Feb-05 22:56 
AnswerRe: for_each calls copy ctor on functor? Pin
Stuart Dootson22-Feb-05 4:00
professionalStuart Dootson22-Feb-05 4:00 
AnswerRe: for_each calls copy ctor on functor? Pin
Andrew Walker23-Feb-05 10:21
Andrew Walker23-Feb-05 10:21 
Easy, add an extra level of redirection to manage the lifetime. This issue is described as Stateful Predicates in the book Exceptional C++

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

using namespace std;

class ProcessVector
{
public:
	ProcessVector()
	{
		cout << "ctor" << endl;
	}
	~ProcessVector()
	{
		cout << "dtor" << endl;
	}
	void operator ()(int i)
	{
		cout << i << endl;
	}

    ProcessVector(const ProcessVector &rhs)
	{
		cout << "copy ctor" << endl;
	}
};

class ProcessVectorIndirect
{
public:
    ProcessVectorIndirect(ProcessVector* process)
        : pProcess(process)
    {
    }

	void operator ()(int i)
	{
		(*pProcess)(i);
	}

private:
    ProcessVector* pProcess;
};

int main(int argc, char* argv[])
{
	std::vector <int> test;
	for (int i = 0 ; i< 5; i++)
		test.push_back(i);
	
        ProcessVector vect;
	for_each(test.begin(), test.end() , ProcessVectorIndirect(&vect) );

	return 0;
}




GeneralATL Controls Pin
muslcesonvacation21-Feb-05 16:48
muslcesonvacation21-Feb-05 16:48 
GeneralEvent is not catched in script Pin
grinder20-Feb-05 22:55
grinder20-Feb-05 22:55 
GeneralRe: Event is not catched in script Pin
Gevorg22-Feb-05 10:14
Gevorg22-Feb-05 10:14 
GeneralRe: Event is not catched in script Pin
grinder23-Feb-05 1:03
grinder23-Feb-05 1:03 
GeneralPlug-in in IE Pin
Pauwl20-Feb-05 21:46
Pauwl20-Feb-05 21:46 
GeneralATL ActiveX Control Pin
muslcesonvacation20-Feb-05 7:34
muslcesonvacation20-Feb-05 7:34 
GeneralRe: ATL ActiveX Control Pin
Michael Dunn20-Feb-05 11:03
sitebuilderMichael Dunn20-Feb-05 11:03 
GeneralRe: ATL ActiveX Control Pin
muslcesonvacation20-Feb-05 12:51
muslcesonvacation20-Feb-05 12:51 
GeneralRe: ATL ActiveX Control Pin
Igor Vigdorchik20-Feb-05 15:14
Igor Vigdorchik20-Feb-05 15:14 
GeneralRe: ATL ActiveX Control Pin
Anonymous21-Feb-05 3:45
Anonymous21-Feb-05 3:45 
GeneralRe: ATL ActiveX Control Pin
muslcesonvacation21-Feb-05 14:01
muslcesonvacation21-Feb-05 14:01 
GeneralWinlogon/Notify packet problem. Pin
dabayi18-Feb-05 2:53
dabayi18-Feb-05 2:53 
GeneralRe: Winlogon/Notify packet problem. Pin
ThatsAlok18-Feb-05 20:47
ThatsAlok18-Feb-05 20:47 
GeneralRe: Winlogon/Notify packet problem. Pin
Jörgen Sigvardsson19-Feb-05 6:31
Jörgen Sigvardsson19-Feb-05 6:31 
GeneralATL App consuming .NET Pin
Chiew Heng Wah17-Feb-05 19:25
Chiew Heng Wah17-Feb-05 19:25 
GeneralRe: ATL App consuming .NET Pin
Gevorg22-Feb-05 10:15
Gevorg22-Feb-05 10:15 
GeneralPWSTR length Pin
dabayi17-Feb-05 1:45
dabayi17-Feb-05 1:45 

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.