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

C / C++ / MFC

 
AnswerRe: GetThreadId - kernel32.dll Pin
Chris Meech1-Nov-06 4:29
Chris Meech1-Nov-06 4:29 
GeneralRe: GetThreadId - kernel32.dll Pin
edvintas1-Nov-06 4:39
edvintas1-Nov-06 4:39 
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 
The only way I can think of doing it, is using an factory of some sort
[edit] Re-written into something that actually compiles! [/edit]
enum EClasses
{
	EClassA=0,
	EClassB,
	EClassC,
	EClassD,
	EClassE,
};

Parent* CreateObject( EClasses type )
{
  Parent* pObj = NULL;
  
  switch( type )
  {
  case EClassA:
    pObj= new CClassA();
    break;

  case EClassB:
    pObj= new CClassB();
    break;

    ..etc..
  }

  return pObj;
}


const int MAX_CLASSES = 10;

typedef struct tagExtractOps
{
	std::string strExtractName;
	int			nCtorCount;
	EClasses	pClasses[MAX_CLASSES];
} TExtractOps;

const  int  NUMBER_OF_OPS    =    3;

TExtractOps ExtractOps[NUMBER_OF_OPS] =  {"OP_1",2,{EClassA,EClassB},"OP_2",3,{EClassA,EClassC,EClassD},"OP_3",1,{EClassE}};


for ( int i = 0; i < NUMBER_OF_OPS; i++ )
{
	for ( int j = 0; j < ExtractOps[i].nCtorCount; j++ )
	{
		Parent*     pExtract    =  CreateObject( ExtractOps[i].pClasses[j] );
		if ( pExtract )
		{
			//....  do a bunch of operations on pExtract

			delete pExtract;
		}
	}
}



-- modified at 9:58 Wednesday 1st November, 2006

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

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 
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 

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.