Click here to Skip to main content
16,006,570 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralParsing XML file Pin
Reveur129-Apr-05 10:28
Reveur129-Apr-05 10:28 
GeneralDisplay a disabled 24-bit image Pin
eddya29-Apr-05 9:44
eddya29-Apr-05 9:44 
GeneralRe: Display a disabled 24-bit image Pin
bmzhao29-Apr-05 14:19
bmzhao29-Apr-05 14:19 
QuestionWhy make a function 'static'? Pin
Chris Meech29-Apr-05 9:35
Chris Meech29-Apr-05 9:35 
AnswerRe: Why make a function 'static'? Pin
David Crow29-Apr-05 9:43
David Crow29-Apr-05 9:43 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:11
Chris Meech2-May-05 2:11 
AnswerRe: Why make a function 'static'? Pin
BambooMoon29-Apr-05 9:50
BambooMoon29-Apr-05 9:50 
AnswerRe: Why make a function 'static'? Pin
Blake Miller29-Apr-05 10:44
Blake Miller29-Apr-05 10:44 
I make member functions static for a few reasons:

1. Entire class is composed of static functions and there is NO member data. No need to make an instance.

2. The static member function is used as a placeholder for a callback, the static function accepts data (such as the ubiquitous LPVOID or LPARAM) and casts it to a pointer of the class and then calls a non-static member function. This is very common to convert a parameter to _beginthreadex, for example, into a class' instance. Also, some Windows API callbacks allow you to pass 'user' data, which I usually make a pointer to a class.

3. The static function returns the pointer to the singleton class' instance.

No knowing much more about the class or its history, it seems like the class you describe needs some serious refactoring. Maybe it was a submission to the 'Obfuscated C++ Code Contest' D'Oh! | :doh:

GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:16
Chris Meech2-May-05 2:16 
GeneralWMI Pin
Alex_Y29-Apr-05 9:01
Alex_Y29-Apr-05 9:01 
GeneralRe: WMI Pin
Alexander M.,29-Apr-05 9:04
Alexander M.,29-Apr-05 9:04 
GeneralRe: WMI Pin
Alex_Y2-May-05 2:12
Alex_Y2-May-05 2:12 
GeneralRe: WMI Pin
David Crow29-Apr-05 9:35
David Crow29-Apr-05 9:35 
GeneralRe: WMI Pin
Alex_Y2-May-05 2:11
Alex_Y2-May-05 2:11 
GeneralEasy Way to Hide Taskbar Button Pin
Anonymous29-Apr-05 8:49
Anonymous29-Apr-05 8:49 
GeneralColors Pin
Anonymous29-Apr-05 7:27
Anonymous29-Apr-05 7:27 
GeneralRe: Colors Pin
Alexander M.,29-Apr-05 9:17
Alexander M.,29-Apr-05 9:17 
GeneralRe: Colors Pin
David Crow29-Apr-05 9:39
David Crow29-Apr-05 9:39 
GeneralUrgent Help Needed on "Multiple Monitors" and "Monitor Tiling" Pin
King 149340029-Apr-05 7:09
King 149340029-Apr-05 7:09 
Generalregistering filetypes for internet explorer Pin
Steve Kearon29-Apr-05 7:05
Steve Kearon29-Apr-05 7:05 
GeneralRe: registering filetypes for internet explorer Pin
David Crow29-Apr-05 9:44
David Crow29-Apr-05 9:44 
GeneralRe: registering filetypes for internet explorer Pin
Steve Kearon29-Apr-05 10:46
Steve Kearon29-Apr-05 10:46 
GeneralCopying project settings Pin
KingOfTheFaireys29-Apr-05 6:56
KingOfTheFaireys29-Apr-05 6:56 
Generalhelp in com wrapper Pin
smarty1229-Apr-05 6:36
smarty1229-Apr-05 6:36 
GeneralRe: help in com wrapper Pin
BlackDice29-Apr-05 11:01
BlackDice29-Apr-05 11:01 

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.