Click here to Skip to main content
15,921,295 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Recursive File Enumeration Pin
BlackDice24-Sep-04 3:20
BlackDice24-Sep-04 3:20 
QuestionHow about this? Pin
Tom Wright23-Sep-04 11:34
Tom Wright23-Sep-04 11:34 
AnswerRe: How about this? Pin
Michael Dunn23-Sep-04 11:42
sitebuilderMichael Dunn23-Sep-04 11:42 
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 11:50
Tom Wright23-Sep-04 11:50 
GeneralRe: How about this? Pin
BlackDice23-Sep-04 11:59
BlackDice23-Sep-04 11:59 
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 12:04
Tom Wright23-Sep-04 12:04 
GeneralRe: How about this? Pin
Michael Dunn23-Sep-04 12:03
sitebuilderMichael Dunn23-Sep-04 12:03 
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 12:24
Tom Wright23-Sep-04 12:24 
Michael Dunn wrote:
Keep in mind that the order of the bytes is CPU-specific. On x86 it's low->high as I showed above.

I see what you are saying. Here is the value that I see when I view it thru quick watch: 0x30270000 Which is reversed from what is in the array.

Okay so if I reverse this then I'll get the right Hex value in my int.

Questions:
1. The value I see in quick watch...is this the hex value or the int value?
2. If it's the hex value then I still need to convert this to a usable int. What I mean is that this BYTE array is part of a data stream from a socket.
<br />
	struct ParseData{<br />
		BYTE STAP[4]; <br />
		BYTE BlockLen[4];<br />
		BYTE HDRLen[2];<br />
		BYTE FunctionCode[2];<br />
		BYTE ValField[4];<br />
		BYTE DataLen[4];<br />
		BYTE MsgStatus[2];<br />
		BYTE Dest[2];<br />
	};<br />
	ParseData myStuff;<br />
	memcpy(&myStuff, dataBuffer, sizeof(myStuff));<br />
	char* DataPacket = new char[myStuff.DataLen];<br />


It tells me the length of another array in the stream which is a datapacket. So this BYTE array is the packet lenght. I've set up the data packet as a char* Datapacket; Can I initialize it like this:

char* DataPacket = new char[n]; ???Confused | :confused: and will this be the size of 10032 or 2730?

Really I'm trying to understand this and I really appreciate your help

Thanks



Tom Wright
tawright915@yahoo.com
GeneralRe: How about this? Pin
Tom Wright23-Sep-04 12:32
Tom Wright23-Sep-04 12:32 
GeneralRe: How about this? Pin
Michael Dunn23-Sep-04 15:13
sitebuilderMichael Dunn23-Sep-04 15:13 
GeneralRe: How about this? Pin
markkuk23-Sep-04 23:58
markkuk23-Sep-04 23:58 
General_CrtIsValidHeapPointer ASSERTS Pin
BlackDice23-Sep-04 10:43
BlackDice23-Sep-04 10:43 
GeneralRe: _CrtIsValidHeapPointer ASSERTS Pin
Michael Dunn23-Sep-04 11:45
sitebuilderMichael Dunn23-Sep-04 11:45 
GeneralRe: _CrtIsValidHeapPointer ASSERTS Pin
BlackDice23-Sep-04 11:51
BlackDice23-Sep-04 11:51 
GeneralTCHAR pointer character count Pin
Gimpy198323-Sep-04 9:53
Gimpy198323-Sep-04 9:53 
GeneralRe: TCHAR pointer character count Pin
João Paulo Figueira23-Sep-04 10:05
professionalJoão Paulo Figueira23-Sep-04 10:05 
GeneralRe: TCHAR pointer character count Pin
Gimpy198323-Sep-04 10:09
Gimpy198323-Sep-04 10:09 
GeneralRe: TCHAR pointer character count Pin
João Paulo Figueira23-Sep-04 11:06
professionalJoão Paulo Figueira23-Sep-04 11:06 
GeneralRe: TCHAR pointer character count Pin
Peter Weyzen23-Sep-04 11:32
Peter Weyzen23-Sep-04 11:32 
GeneralRe: TCHAR pointer character count Pin
Michael Dunn23-Sep-04 11:49
sitebuilderMichael Dunn23-Sep-04 11:49 
QuestionSource code formatter? Pin
Ravi Bhavnani23-Sep-04 9:53
professionalRavi Bhavnani23-Sep-04 9:53 
AnswerRe: Source code formatter? Pin
markkuk23-Sep-04 10:27
markkuk23-Sep-04 10:27 
GeneralRe: Source code formatter? Pin
Ravi Bhavnani23-Sep-04 12:31
professionalRavi Bhavnani23-Sep-04 12:31 
GeneralRecommend a free unit testing framework Pin
hyling23-Sep-04 9:44
hyling23-Sep-04 9:44 
GeneralRe: Recommend a free unit testing framework Pin
Ravi Bhavnani23-Sep-04 9:51
professionalRavi Bhavnani23-Sep-04 9:51 

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.