Click here to Skip to main content
16,015,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GetThreadId - kernel32.dll Pin
Chris Meech1-Nov-06 5:16
Chris Meech1-Nov-06 5:16 
GeneralRe: GetThreadId - kernel32.dll Pin
edvintas1-Nov-06 6:21
edvintas1-Nov-06 6:21 
QuestionRe: GetThreadId - kernel32.dll Pin
Hamid_RT1-Nov-06 5:23
Hamid_RT1-Nov-06 5:23 
AnswerRe: GetThreadId - kernel32.dll Pin
Niklas L1-Nov-06 20:46
Niklas L1-Nov-06 20:46 
QuestionFunction Pointers and ctors. Pin
Chris Meech1-Nov-06 2:35
Chris Meech1-Nov-06 2:35 
AnswerRe: Function Pointers and ctors. [modified] Pin
benjymous1-Nov-06 3:42
benjymous1-Nov-06 3:42 
GeneralRe: Function Pointers and ctors. Pin
Chris Meech1-Nov-06 4:18
Chris Meech1-Nov-06 4:18 
GeneralRe: Function Pointers and ctors. Pin
benjymous1-Nov-06 4:42
benjymous1-Nov-06 4:42 
A colleague of mine is a big fan of using complex define systems

something like:

ClassDefinitions.h
DECLARE_CLASS( ClassA )
DECLARE_CLASS( ClassB )
DECLARE_CLASS( ClassC )


enum EClasses
{
#define DECLARE_CLASS( unique_class_name ) E##unique_class_name,
#include "ClassDefinitions.h"
#undef DECLARE_CLASS
}


Parent* CreateObject( EClasses type )
{
	Parent* pObj = NULL;

	switch( type )
	{
#define DECLARE_CLASS( unique_class_name ) \
	case E##unique_class_name: \
	  pObj= new C##unique_class_name(); \
	  break;
#include "ClassDefinitions.h"
#undef DECLARE_CLASS
	}

	return pObj;
}


This means you don't need to manually update the enum and factory, you just have to update the single header file. However, it makes code that is much harder to read and understand, so there's a tradeoff there

--
Help me! I'm turning into a grapefruit!
Buzzwords!

Questionproblem with gethostbyaddr() Pin
priyank_ldce1-Nov-06 2:15
priyank_ldce1-Nov-06 2:15 
AnswerRe: problem with gethostbyaddr() Pin
David Crow1-Nov-06 3:32
David Crow1-Nov-06 3:32 
GeneralRe: problem with gethostbyaddr() Pin
priyank_ldce1-Nov-06 6:05
priyank_ldce1-Nov-06 6:05 
GeneralRe: problem with gethostbyaddr() Pin
David Crow1-Nov-06 7:14
David Crow1-Nov-06 7:14 
GeneralRe: problem with gethostbyaddr() Pin
priyank_ldce1-Nov-06 22:39
priyank_ldce1-Nov-06 22:39 
QuestionListing Video Capture Devices Pin
ceejeeb1-Nov-06 2:11
ceejeeb1-Nov-06 2:11 
AnswerRe: Listing Video Capture Devices Pin
Mark Salsbery1-Nov-06 6:08
Mark Salsbery1-Nov-06 6:08 
GeneralRe: Listing Video Capture Devices Pin
ceejeeb2-Nov-06 2:41
ceejeeb2-Nov-06 2:41 
QuestionChange name Activex Control Project Pin
Demian Panello1-Nov-06 1:33
Demian Panello1-Nov-06 1:33 
AnswerRe: Change name Activex Control Project Pin
TClarke1-Nov-06 4:59
TClarke1-Nov-06 4:59 
QuestionHow to access the instances of the counters of the Performance object from Perfmon Pin
suresh_suryavanshi1-Nov-06 1:18
suresh_suryavanshi1-Nov-06 1:18 
AnswerRe: How to access the instances of the counters of the Performance object from Perfmon Pin
David Crow1-Nov-06 3:34
David Crow1-Nov-06 3:34 
GeneralRe: How to access the instances of the counters of the Performance object from Perfmon Pin
suresh_suryavanshi2-Nov-06 3:20
suresh_suryavanshi2-Nov-06 3:20 
QuestionRe: How to access the instances of the counters of the Performance object from Perfmon Pin
David Crow2-Nov-06 4:47
David Crow2-Nov-06 4:47 
Questiondisable paint messages to a control Pin
flippydeflippydebop1-Nov-06 0:31
flippydeflippydebop1-Nov-06 0:31 
AnswerRe: disable paint messages to a control Pin
Tony Hill1-Nov-06 0:39
professionalTony Hill1-Nov-06 0:39 
AnswerRe: disable paint messages to a control Pin
Nibu babu thomas1-Nov-06 0:46
Nibu babu thomas1-Nov-06 0:46 

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.