Click here to Skip to main content
15,893,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Popup Menu Pin
korte253-Jan-09 22:05
korte253-Jan-09 22:05 
GeneralRe: Popup Menu Pin
korte253-Jan-09 22:25
korte253-Jan-09 22:25 
GeneralRe: Popup Menu Pin
Stephen Hewitt3-Jan-09 21:55
Stephen Hewitt3-Jan-09 21:55 
GeneralRe: Popup Menu Pin
korte253-Jan-09 22:06
korte253-Jan-09 22:06 
QuestionBit manipulation useing "Bit Field" in C++ Pin
Joseph Marzbani3-Jan-09 5:43
Joseph Marzbani3-Jan-09 5:43 
GeneralRe: Bit manipulation useing "Bit Field" in C++ Pin
Luc Pattyn3-Jan-09 6:07
sitebuilderLuc Pattyn3-Jan-09 6:07 
AnswerRe: Bit manipulation useing "Bit Field" in C++ Pin
Stuart Dootson3-Jan-09 17:02
professionalStuart Dootson3-Jan-09 17:02 
AnswerRe: Bit manipulation useing "Bit Field" in C++ Pin
krmed4-Jan-09 3:33
krmed4-Jan-09 3:33 
You're on the right track, but remember that a BYTE is 8 bits, so you can't just use aBytes + iCountor to increment the way you are.

One suggestion would be to decode three bytes (four values) at a time in your loop:
struct CHUNKS
{
	DWORD First:6;
	DWORD Second:6;
	DWORD Third:6;
	DWORD Fourth:6;
} *pChunk = NULL;

int iCountor = 0;

for (iCountor = 0; iCountor < Size_Of_aBytes; iCountor += 3)
{
	if ((iCountor + 3) <= Size_Of_aBytes)	// you have at least three bytes left, so get them all
	{
		pChunk = (CHUNKS*) (aBytes + iCountor);
		// now you can get pChunk->First, pChunk->Second, pChunk->Third, and pChunk->Fourth
		// this takes care of the first three bytes of aBytes, the next time through the loop
		// will get the next three bytes (4 values).
	}
	else
	{
			// when you get here, aBytes will only have one or two bytes of data left,
			// so you can only access one or two of the variables safely.
			
			// I'll leave this up to you.
	}
}

Note that this is UNTESTED code, but should give you what you're looking for.

Hope that helps.

Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

QuestionDebug Assertion Failure Pin
bhanu_85093-Jan-09 1:32
bhanu_85093-Jan-09 1:32 
AnswerRe: Debug Assertion Failure Pin
SandipG 3-Jan-09 1:39
SandipG 3-Jan-09 1:39 
AnswerRe: Debug Assertion Failure Pin
ThatsAlok5-Jan-09 0:28
ThatsAlok5-Jan-09 0:28 
Questionhelp me... Pin
surender992-Jan-09 21:58
surender992-Jan-09 21:58 
AnswerRe: help me... Pin
Code-o-mat3-Jan-09 3:22
Code-o-mat3-Jan-09 3:22 
QuestionHow can Create new rect with width? Pin
Le@rner2-Jan-09 20:05
Le@rner2-Jan-09 20:05 
AnswerRe: How can Create new rect with width? Pin
Hamid_RT2-Jan-09 20:27
Hamid_RT2-Jan-09 20:27 
GeneralRe: How can Create new rect with width? Pin
Le@rner2-Jan-09 20:47
Le@rner2-Jan-09 20:47 
GeneralRe: How can Create new rect with width? Pin
Hamid_RT3-Jan-09 0:16
Hamid_RT3-Jan-09 0:16 
AnswerRe: How can Create new rect with width? Pin
CPallini2-Jan-09 20:50
mveCPallini2-Jan-09 20:50 
GeneralRe: How can Create new rect with width? Pin
Le@rner2-Jan-09 20:55
Le@rner2-Jan-09 20:55 
GeneralRe: How can Create new rect with width? Pin
CPallini2-Jan-09 21:04
mveCPallini2-Jan-09 21:04 
GeneralRe: How can Create new rect with width? Pin
Le@rner2-Jan-09 21:16
Le@rner2-Jan-09 21:16 
GeneralRe: How can Create new rect with width? Pin
CPallini3-Jan-09 2:49
mveCPallini3-Jan-09 2:49 
AnswerRe: How can Create new rect with width? Pin
Michael Dunn3-Jan-09 18:41
sitebuilderMichael Dunn3-Jan-09 18:41 
QuestionReleasing memory occupied by controls Pin
VCProgrammer2-Jan-09 19:06
VCProgrammer2-Jan-09 19:06 
AnswerRe: Releasing memory occupied by controls [modified] Pin
Le@rner2-Jan-09 19:33
Le@rner2-Jan-09 19:33 

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.