Click here to Skip to main content
16,005,206 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 5:55
Link260020-Mar-06 5:55 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
toxcct20-Mar-06 6:01
toxcct20-Mar-06 6:01 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 6:12
Link260020-Mar-06 6:12 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
toxcct20-Mar-06 6:17
toxcct20-Mar-06 6:17 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 6:21
Link260020-Mar-06 6:21 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Michael Dunn20-Mar-06 7:59
sitebuilderMichael Dunn20-Mar-06 7:59 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Stephen Hewitt20-Mar-06 11:44
Stephen Hewitt20-Mar-06 11:44 
QuestionBit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 5:06
Iain Clarke, Warrior Programmer20-Mar-06 5:06 
I have a minor problem. I have a bit field (see below). I also have a few places where I deal
with the different parts of it. I've recently had to change the size of one of the fields, and
have to find all the places I've hardwired the old size.

If this was an array of BOOL / bools, I could use the sizeof operator. Is there any way of
deriving the size of the fields simply from the code?

I know there are various brute force approaches, use NUM_LAYERS_OVERLAYS (etc) everywhere,
change to struct containing a load of BOOLs, or BYTES, but the purist in me is intrigued
as to whether there is a more elegant solution....

Suggestions please?

Iain.

union _Layers_
{
	DWORD	dwAll;
	struct _Parts_
	{
		DWORD dwImage		: 1;
		DWORD dwMesh		: 1;
		DWORD dwShapeMatch	: 1;
		DWORD dwComments	: NUM_LAYERS_COMMENTS;
		DWORD dwSelections	: NUM_LAYERS_SELECTIONS;
		DWORD dwOverlay		: NUM_LAYERS_OVERLAYS;
	} Parts;

	_Layers_ ()
	{
		dwAll = -1; // All on
	}
};

AnswerRe: Bit Fields, and sub field size. Pin
Bob Flynn20-Mar-06 8:21
Bob Flynn20-Mar-06 8:21 
GeneralRe: Bit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 21:40
Iain Clarke, Warrior Programmer20-Mar-06 21:40 
GeneralRe: Bit Fields, and sub field size. Pin
Bob Flynn21-Mar-06 3:05
Bob Flynn21-Mar-06 3:05 
Questionassertion errors Pin
theprinc20-Mar-06 4:52
theprinc20-Mar-06 4:52 
AnswerRe: assertion errors Pin
PJ Arends20-Mar-06 5:05
professionalPJ Arends20-Mar-06 5:05 
GeneralRe: assertion errors Pin
theprinc20-Mar-06 5:22
theprinc20-Mar-06 5:22 
GeneralRe: assertion errors Pin
PJ Arends21-Mar-06 15:56
professionalPJ Arends21-Mar-06 15:56 
Questionin/out in visual c++ Pin
a_yosef20-Mar-06 4:45
a_yosef20-Mar-06 4:45 
AnswerRe: in/out in visual c++ Pin
PJ Arends20-Mar-06 5:10
professionalPJ Arends20-Mar-06 5:10 
Questionmade by Borland Pin
militiaware20-Mar-06 4:30
militiaware20-Mar-06 4:30 
AnswerRe: made by Borland Pin
toxcct20-Mar-06 4:45
toxcct20-Mar-06 4:45 
QuestionCall another exe Programatically Pin
HNGuruPrasad20-Mar-06 4:28
HNGuruPrasad20-Mar-06 4:28 
AnswerRe: Call another exe Programatically Pin
Michael Dunn20-Mar-06 8:01
sitebuilderMichael Dunn20-Mar-06 8:01 
Questionostringstream: special characters "/" or "?" ? Pin
Sebastian Schneider20-Mar-06 4:07
Sebastian Schneider20-Mar-06 4:07 
AnswerRe: ostringstream: special characters "/" or "?" ? Pin
PJ Arends20-Mar-06 4:44
professionalPJ Arends20-Mar-06 4:44 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
toxcct20-Mar-06 4:47
toxcct20-Mar-06 4:47 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
PJ Arends20-Mar-06 4:54
professionalPJ Arends20-Mar-06 4:54 

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.