Click here to Skip to main content
15,899,126 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory usage Pin
Waldermort30-Oct-06 7:13
Waldermort30-Oct-06 7:13 
GeneralRe: Memory usage Pin
Hamid_RT30-Oct-06 8:14
Hamid_RT30-Oct-06 8:14 
GeneralRe: Memory usage Pin
Stephen Hewitt30-Oct-06 12:06
Stephen Hewitt30-Oct-06 12:06 
QuestionCallback function Pin
PasNad30-Oct-06 2:13
PasNad30-Oct-06 2:13 
AnswerRe: Callback function Pin
Emilio Garavaglia30-Oct-06 2:53
Emilio Garavaglia30-Oct-06 2:53 
AnswerRe: Callback function Pin
Rage30-Oct-06 2:56
professionalRage30-Oct-06 2:56 
AnswerRe: Callback function Pin
Hamid_RT30-Oct-06 3:37
Hamid_RT30-Oct-06 3:37 
AnswerRe: Callback function Pin
Zac Howland30-Oct-06 3:38
Zac Howland30-Oct-06 3:38 
A callback function is not exclusive to C++. That said, in C++, you can have pointers to either datatypes or to functions. When you have a pointer to a function, you can pass it to an object/function that takes such a pointer and it can use it to call that callback function when it needs to.

Basically, imagine it this way: I have a function Q() that is a specialized function I want called whenever the data in object A is in a certain state. Q() is passed to A via A's constructor, and each time a method on A is called, the state is checked. When the state is what I want it to be, Q() is called via the pointer that A has. This allows me to have several functions with the same signature as Q() that may do things differently (e.g. if Q() was a logging function, I may have one function that logs to a CSV file, and another that does so in XML). I can switch which callback is used at runtime without making any code changes. (Just one example).

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: Callback function Pin
PasNad30-Oct-06 14:06
PasNad30-Oct-06 14:06 
GeneralRe: Callback function Pin
Zac Howland31-Oct-06 5:02
Zac Howland31-Oct-06 5:02 
Questionregistering a plugin Pin
saqib8230-Oct-06 1:58
saqib8230-Oct-06 1:58 
AnswerRe: registering a plugin Pin
albertino callientes30-Oct-06 2:28
albertino callientes30-Oct-06 2:28 
GeneralRe: registering a plugin Pin
saqib8230-Oct-06 2:32
saqib8230-Oct-06 2:32 
GeneralRe: registering a plugin Pin
led mike30-Oct-06 5:32
led mike30-Oct-06 5:32 
QuestionFunction Pointer or Class Pointer ? Pin
Mr.Brainley30-Oct-06 1:15
Mr.Brainley30-Oct-06 1:15 
AnswerRe: Function Pointer or Class Pointer ? Pin
Blake Miller30-Oct-06 3:55
Blake Miller30-Oct-06 3:55 
QuestionQuestion about list Box Pin
zizzzz30-Oct-06 0:40
zizzzz30-Oct-06 0:40 
AnswerRe: Question about list Box Pin
KarstenK30-Oct-06 0:52
mveKarstenK30-Oct-06 0:52 
AnswerRe: Question about list Box Pin
uday kiran janaswamy30-Oct-06 1:05
uday kiran janaswamy30-Oct-06 1:05 
GeneralRe: Question about list Box Pin
zizzzz30-Oct-06 1:18
zizzzz30-Oct-06 1:18 
GeneralRe: Question about list Box Pin
uday kiran janaswamy30-Oct-06 1:21
uday kiran janaswamy30-Oct-06 1:21 
GeneralRe: Question about list Box Pin
zizzzz30-Oct-06 1:36
zizzzz30-Oct-06 1:36 
GeneralRe: Question about list Box Pin
uday kiran janaswamy30-Oct-06 1:48
uday kiran janaswamy30-Oct-06 1:48 
GeneralRe: Question about list Box Pin
zizzzz30-Oct-06 2:16
zizzzz30-Oct-06 2:16 
AnswerRe: Question about list Box Pin
David Crow30-Oct-06 3:18
David Crow30-Oct-06 3:18 

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.