Click here to Skip to main content
14,331,758 members

C / C++ / MFC

 
AnswerRe: Changing CMainFrame Minimize ICON Pin
ForNow10-Jan-19 4:39
memberForNow10-Jan-19 4:39 
GeneralRe: Changing CMainFrame Minimize ICON Pin
David Crow10-Jan-19 4:42
memberDavid Crow10-Jan-19 4:42 
GeneralRe: Changing CMainFrame Minimize ICON Pin
ForNow10-Jan-19 5:09
memberForNow10-Jan-19 5:09 
QuestionUsage of bitset ? Pin
Vaclav_9-Jan-19 5:12
memberVaclav_9-Jan-19 5:12 
AnswerRe: Usage of bitset ? Pin
Daniel Pfeffer9-Jan-19 5:46
professionalDaniel Pfeffer9-Jan-19 5:46 
AnswerRe: Usage of bitset ? Pin
k50549-Jan-19 6:09
memberk50549-Jan-19 6:09 
GeneralRe: Usage of bitset ? Pin
Daniel Pfeffer9-Jan-19 21:38
professionalDaniel Pfeffer9-Jan-19 21:38 
GeneralRe: Usage of bitset ? Pin
Vaclav_10-Jan-19 4:39
memberVaclav_10-Jan-19 4:39 
Thanks,
this will definitely give me a good start in using bitset, specially when I need to process more than two characters. Appreciate it.
At current I have this code to process single char.

	// build a common function to set / reset bits
	// shift data into correct bit postion
	cout << " data 0x" << hex << +data << endl;
	data <<= iLSbit;
	cout << " shifted data 0x" << hex << +data << endl;
	int iDataBit;
	for (int iBit = iLSbit; iBit != iMSbit + 1; iBit++) {
#ifdef DEBUG
		cout << "processing  bit " << dec << +iBit << endl;
		// clear bit
		buf[0] &= ~(1UL << iBit); // don't need this
#endif
		// set or reset bit
		// check data bit @ position
		iDataBit = (data >> iBit) & 1U;
#ifdef DEBUG
		cout << " iDataBit " << hex << +iDataBit << endl;
#endif
		if (iDataBit) {
#ifdef DEBUG
			cout << "set bit  @ position " << dec << iBit << endl;
#endif
			buf[0] |= (1UL << iBit);
		} else {
#ifdef DEBUG
			cout << "clear bit @ position " << dec << iBit << endl;
#endif
			// clear bit
			buf[0] &= ~(1UL << iBit);
		}
	}


Since I need to read the data (hardware register ) before modifying it , then writing it back to hardware it seems simpler than using bitset.
At present I am modifying / checking single register parameter ( A/D converter input MUX ) , but in future I like to modify all parameters in single access. I think that is where bitset will do the job.


Thanks again
Cheers
Vaclav
QuestionVC++ 2017 redistributables versions. Pin
Maximilien8-Jan-19 4:21
memberMaximilien8-Jan-19 4:21 
AnswerRe: VC++ 2017 redistributables versions. Pin
Victor Nijegorodov8-Jan-19 8:43
memberVictor Nijegorodov8-Jan-19 8:43 
GeneralRe: VC++ 2017 redistributables versions. Pin
Maximilien8-Jan-19 9:01
memberMaximilien8-Jan-19 9:01 
GeneralRe: VC++ 2017 redistributables versions. Pin
Victor Nijegorodov8-Jan-19 9:03
memberVictor Nijegorodov8-Jan-19 9:03 
QuestionSubclassing a listcontrol in dialog bar Pin
manoharbalu6-Jan-19 23:48
membermanoharbalu6-Jan-19 23:48 
AnswerRe: Subclassing a listcontrol in dialog bar Pin
Victor Nijegorodov7-Jan-19 2:12
memberVictor Nijegorodov7-Jan-19 2:12 
Questionupdating output value with timer and resetting if the timer exceeds a certain time or it has a new input value Pin
crucial19536-Jan-19 14:42
membercrucial19536-Jan-19 14:42 
SuggestionRe: updating output value with timer and resetting if the timer exceeds a certain time or it has a new input value Pin
David Crow6-Jan-19 14:59
memberDavid Crow6-Jan-19 14:59 
AnswerRe: updating output value with timer and resetting if the timer exceeds a certain time or it has a new input value Pin
leon de boer6-Jan-19 16:17
memberleon de boer6-Jan-19 16:17 
QuestionSeperate source code for the tokens in the compiler c++ Pin
Member 141086114-Jan-19 20:10
memberMember 141086114-Jan-19 20:10 
AnswerRe: Seperate source code for the tokens in the compiler c++ Pin
Richard MacCutchan4-Jan-19 22:08
protectorRichard MacCutchan4-Jan-19 22:08 
AnswerRe: Seperate source code for the tokens in the compiler c++ Pin
jschell5-Jan-19 5:59
memberjschell5-Jan-19 5:59 
QuestionPostmessage Not Working With WH_GETMESSAGE-MFC Pin
srinivasankrishnaa1-Jan-19 20:11
membersrinivasankrishnaa1-Jan-19 20:11 
AnswerRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
Richard MacCutchan1-Jan-19 22:08
protectorRichard MacCutchan1-Jan-19 22:08 
GeneralRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
srinivasankrishnaa1-Jan-19 22:25
membersrinivasankrishnaa1-Jan-19 22:25 
GeneralRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
Richard MacCutchan1-Jan-19 23:10
protectorRichard MacCutchan1-Jan-19 23:10 
GeneralRe: Postmessage Not Working With WH_GETMESSAGE-MFC Pin
leon de boer2-Jan-19 17:44
memberleon de boer2-Jan-19 17:44 

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.