Click here to Skip to main content

ATL / WTL / STL

 
AnswerRe: How To Use Macro In dsp file(VC6.0 *.dsp file) PinmvpRichard MacCutchan28-Nov-12 0:34 
QuestionAccessibleObjectFromWindow returns E_ACCESSDENIED PinmemberBianChengNan26-Nov-12 0:04 
QuestionHow to use NTGraph3D Activex Control in Visual Studio 2010. PinmemberDhrumilS23-Nov-12 1:44 
Newshacker240union Pinmemberhacker240union23-Nov-12 0:40 
Questioncopying AAComBSTR to BYTE PinmemberV K 220-Nov-12 21:56 
AnswerRe: copying AAComBSTR to BYTE PinmvpRichard MacCutchan20-Nov-12 22:28 
AnswerRe: copying AAComBSTR to BYTE Pinmemberhacker240union23-Nov-12 0:27 
QuestionC++ Delegate/Events PinmemberEdward G Dana14-Nov-12 18:15 
Greetings,

I just recently started some experiments with C++. I'm an experienced programmer, but not with C++, but, just for fun, I decided to implement this example C++ Delegate here on Code Project.

This example keeps the methods hooked into the delegate inside structs. In the example given these are: struct TShapes, struct TDerivedShapes and struct TThings. These are then initialized in this fashion: event += new MyEvent::T(&shapes, &TShapes::Square);

My question is this: is it necessary to store the methods to be hooked into these events into a struct? I assume this is done because the struct makes the address available to be used in the delegate. If the answer to this question is no, then how do you hook into the even just through standard methods within a normal C++ program? Please forgive the stupidity of my questions. Smile | :)

Ed.
AnswerRe: C++ Delegate/Events PinmvpRichard MacCutchan14-Nov-12 21:57 
GeneralRe: C++ Delegate/Events PinmemberEdward G Dana15-Nov-12 14:35 
GeneralRe: C++ Delegate/Events PinmvpRichard MacCutchan16-Nov-12 0:45 
AnswerRe: C++ Delegate/Events Pinmemberpasztorpisti20-Nov-12 3:53 
GeneralRe: C++ Delegate/Events PinmemberEDanaII20-Nov-12 17:23 
QuestionReturn FALSE in InitInstance causes crash in 64Bits Pinmemberkhaliloenit8-Nov-12 2:01 
AnswerRe: Return FALSE in InitInstance causes crash in 64Bits PinmemberAlbert Holguin10-Dec-12 5:30 
QuestionHow to get used dll's path information programetically? Pinmemberlitu kumar6-Nov-12 20:38 
AnswerRe: How to get used dll's path information programetically? PinmvpRichard MacCutchan6-Nov-12 22:40 
GeneralRe: How to get used dll's path information programetically? [modified] Pinmemberlitu kumar7-Nov-12 0:27 
GeneralRe: How to get used dll's path information programetically? PinmvpRichard MacCutchan7-Nov-12 5:54 
GeneralRe: How to get used dll's path information programetically? Pinmemberlitu kumar7-Nov-12 18:11 
GeneralRe: How to get used dll's path information programetically? PinmvpRichard MacCutchan7-Nov-12 22:34 
GeneralRe: How to get used dll's path information programetically? Pinmemberlitu kumar7-Nov-12 23:35 
GeneralRe: How to get used dll's path information programetically? PinmvpRichard MacCutchan8-Nov-12 1:16 
GeneralRe: How to get used dll's path information programetically? [modified] Pinmemberlitu kumar8-Nov-12 3:58 
GeneralRe: How to get used dll's path information programetically? PinmvpRichard MacCutchan8-Nov-12 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150414.1 | Last Updated 13 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid