Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Bob Flynn wrote:
When you use parts, you reference by variable name


Don't worry, I do know that. This structure hold bits toggling whether some display features are turned on or off in my software.

I also have a dialog box, which shows a column of checkboxes on one side, and the "type" of bit on the other. When I changed the number of bits for each parts, I needed to change the dialog box. I was thinking of a way for the dialog box to automatically recongnise the changes if I made more in 2 years time.

I have since thought of a solution (in the bath, so I haven't tried it yet).

_Layer_ L.
int nBits;
L.dwAll = -1; // set all the bits high.

nBits = L.Parts.dwComments; // nBits now has N bits set.
nBits++; // nBits is now a power of 2.
nBits = log (nBits, 2); // And the number of bits is now known!


I'm sure I haven't got the syntax of the log command right, but the principal is there.

This was more of a puzzle than a real problem, as I did have alternative (but less pretty) ways of solving the problem.

Thanks,

Iain.
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 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
Sebastian Schneider21-Mar-06 0:35
Sebastian Schneider21-Mar-06 0:35 
QuestionInstantiating classes within classes Pin
kialmur20-Mar-06 4:02
kialmur20-Mar-06 4:02 

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.