Click here to Skip to main content
15,908,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Static member funciton call non-static function Pin
bmzhao21-Nov-04 13:57
bmzhao21-Nov-04 13:57 
GeneralRe: Static member funciton call non-static function Pin
Christian Graus21-Nov-04 14:29
protectorChristian Graus21-Nov-04 14:29 
GeneralRe: Static member funciton call non-static function Pin
nguyenvhn21-Nov-04 22:27
nguyenvhn21-Nov-04 22:27 
GeneralRe: Static member funciton call non-static function Pin
Christian Graus21-Nov-04 22:59
protectorChristian Graus21-Nov-04 22:59 
GeneralRe: Static member funciton call non-static function Pin
nguyenvhn21-Nov-04 23:36
nguyenvhn21-Nov-04 23:36 
GeneralRe: Static member funciton call non-static function Pin
Christian Graus21-Nov-04 23:43
protectorChristian Graus21-Nov-04 23:43 
GeneralRe: Static member funciton call non-static function Pin
nguyenvhn22-Nov-04 0:25
nguyenvhn22-Nov-04 0:25 
GeneralRe: Static member funciton call non-static function Pin
Steve S22-Nov-04 0:32
Steve S22-Nov-04 0:32 
In general, I agree with Christian on this.


Christian Graus wrote:
A design principle of C++ is to allow bad coding, and trust that coders will write good code, so they never have to fight the language. What you propose is possible, that doesn't make it good coding practice.

And Microsoft encourages this practice Smile | :) with Windows callback functions.

The callback (if implemented as part of a C++ class) has to be a static member, but in general, what's done is that there's a programmer-supplied value (usually void*) that can be passed as well as the function address.

In those cases the approach is to pass the address of an instance of the class, as has been previously suggested.

Steve S
Developer for hire
GeneralTutorial for Visual C++ .NET 2003 Pin
Rylogy21-Nov-04 9:37
Rylogy21-Nov-04 9:37 
QuestionSTL fstream brakedown in VS .NET? Pin
Robert Bielik21-Nov-04 9:08
Robert Bielik21-Nov-04 9:08 
AnswerRe: STL fstream brakedown in VS .NET? Pin
Aamir Butt21-Nov-04 20:34
Aamir Butt21-Nov-04 20:34 
GeneralRe: STL fstream brakedown in VS .NET? Pin
Robert Bielik21-Nov-04 20:42
Robert Bielik21-Nov-04 20:42 
GeneralBits; Pin
Bo Hunter21-Nov-04 8:38
Bo Hunter21-Nov-04 8:38 
GeneralRe: Bits; Pin
Neville Franks21-Nov-04 10:13
Neville Franks21-Nov-04 10:13 
GeneralRe: Bits; Pin
Bo Hunter21-Nov-04 12:17
Bo Hunter21-Nov-04 12:17 
GeneralRe: Bits; Pin
Henry miller22-Nov-04 2:48
Henry miller22-Nov-04 2:48 
QuestionHow to create a bitmap using pixel color information in WindowsCE? Pin
mutpan21-Nov-04 7:52
mutpan21-Nov-04 7:52 
GeneralCreate folder Pin
DanYELL21-Nov-04 5:28
DanYELL21-Nov-04 5:28 
GeneralRe: Create folder Pin
John R. Shaw21-Nov-04 5:52
John R. Shaw21-Nov-04 5:52 
GeneralRe: Create folder Pin
Renjith Ramachandran21-Nov-04 7:56
Renjith Ramachandran21-Nov-04 7:56 
GeneralRe: Create folder Pin
ThatsAlok21-Nov-04 17:32
ThatsAlok21-Nov-04 17:32 
GeneralCapture and CHANGE ip packets Pin
kydfru21-Nov-04 3:22
kydfru21-Nov-04 3:22 
GeneralRe: Capture and CHANGE ip packets Pin
benjymous21-Nov-04 22:50
benjymous21-Nov-04 22:50 
QuestionWhat to replace macro in C/C++? Pin
Link260021-Nov-04 2:32
Link260021-Nov-04 2:32 
AnswerRe: What to replace macro in C/C++? Pin
Jörgen Sigvardsson21-Nov-04 2:38
Jörgen Sigvardsson21-Nov-04 2:38 

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.