Click here to Skip to main content
15,888,968 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HELP: I don't know why my pointer changing shapes not consistant? Pin
THAQCD5-Aug-09 4:31
THAQCD5-Aug-09 4:31 
QuestionCHtmlView and IE version Pin
BadJerry3-Aug-09 7:15
BadJerry3-Aug-09 7:15 
AnswerRe: CHtmlView and IE version Pin
Bacon Ultimate Cheeseburger3-Aug-09 11:46
Bacon Ultimate Cheeseburger3-Aug-09 11:46 
QuestionByte Swapping Big End to Little End Pin
Grahamfff3-Aug-09 6:42
Grahamfff3-Aug-09 6:42 
AnswerRe: Byte Swapping Big End to Little End Pin
Chris Losinger3-Aug-09 9:20
professionalChris Losinger3-Aug-09 9:20 
AnswerRe: Byte Swapping Big End to Little End Pin
Luc Pattyn3-Aug-09 9:35
sitebuilderLuc Pattyn3-Aug-09 9:35 
AnswerRe: Byte Swapping Big End to Little End Pin
«_Superman_»3-Aug-09 18:59
professional«_Superman_»3-Aug-09 18:59 
GeneralRe: Byte Swapping Big End to Little End Pin
Grahamfff4-Aug-09 3:02
Grahamfff4-Aug-09 3:02 
Thanks for the posts, I did try the following code, but am I on the right track as the float did not work.

struct RXData {
      double    timeStamp;              
      double    item1;           
      long	item2;       
      double    item3;      
      int	 flag1;      
      bool	state;  
}

float swap(float d) 
{ 
	float a; 
	unsigned char *dst = (unsigned char *)&a; 
	unsigned char *src = (unsigned char *)&d; 
	dst[0] = src[3];
	dst[1] = src[2];
	dst[2] = src[1];
	dst[3] = src[0]; 
	return a; 
} 

short byteSwap16(short value)
{
  short newValue = 0;
  char* pnewValue = (char*) &newValue;
  char* poldValue = (char*) &value;
 
  pnewValue[0] = poldValue[1];
  pnewValue[1] = poldValue[0];
 
  return newValue;
}
 
unsigned long byteSwap32(unsigned long value)
{
  unsigned long  newValue = 0;
  char* pnewValue = (char *) &newValue;
  char* poldValue = (char *) &value;
 
  pnewValue[0] = poldValue[3];
  pnewValue[1] = poldValue[2];
  pnewValue[2] = poldValue[1];
  pnewValue[3] = poldValue[0];
 
  return newValue ;
}

RxData.timeStamp = swap(RxData.timeStamp
);

grahamfff

QuestionFacing problem while file reading Pin
bhanu_reddy093-Aug-09 6:25
bhanu_reddy093-Aug-09 6:25 
QuestionRe: Facing problem while file reading Pin
Rajesh R Subramanian3-Aug-09 6:56
professionalRajesh R Subramanian3-Aug-09 6:56 
AnswerRe: Facing problem while file reading Pin
bhanu_reddy093-Aug-09 18:15
bhanu_reddy093-Aug-09 18:15 
GeneralRe: Facing problem while file reading Pin
Rajesh R Subramanian3-Aug-09 20:56
professionalRajesh R Subramanian3-Aug-09 20:56 
QuestionIs it a GDI+ flaw? or I am missing something? Pin
transoft3-Aug-09 6:17
transoft3-Aug-09 6:17 
AnswerRe: Is it a GDI+ flaw? or I am missing something? Pin
Michael Dunn3-Aug-09 9:41
sitebuilderMichael Dunn3-Aug-09 9:41 
GeneralRe: Is it a GDI+ flaw? or I am missing something? [modified] Pin
transoft3-Aug-09 10:13
transoft3-Aug-09 10:13 
GeneralRe: Is it a GDI+ flaw? or I am missing something? Pin
Michael Dunn3-Aug-09 11:50
sitebuilderMichael Dunn3-Aug-09 11:50 
GeneralRe: Is it a GDI+ flaw? or I am missing something? Pin
transoft3-Aug-09 13:01
transoft3-Aug-09 13:01 
GeneralRe: Is it a GDI+ flaw? or I am missing something? Pin
transoft10-Aug-09 5:29
transoft10-Aug-09 5:29 
GeneralRe: Is it a GDI+ flaw? or I am missing something? Pin
Michael Dunn10-Aug-09 13:50
sitebuilderMichael Dunn10-Aug-09 13:50 
QuestionFirst Time Visual C++ User - Compiler Problems Pin
BSO_VC3-Aug-09 5:28
BSO_VC3-Aug-09 5:28 
QuestionRe: First Time Visual C++ User - Compiler Problems Pin
David Crow3-Aug-09 5:43
David Crow3-Aug-09 5:43 
AnswerRe: First Time Visual C++ User - Compiler Problems Pin
BSO_VC3-Aug-09 6:42
BSO_VC3-Aug-09 6:42 
QuestionRe: First Time Visual C++ User - Compiler Problems Pin
David Crow3-Aug-09 7:12
David Crow3-Aug-09 7:12 
AnswerRe: First Time Visual C++ User - Compiler Problems Pin
BSO_VC3-Aug-09 7:40
BSO_VC3-Aug-09 7:40 
QuestionRe: First Time Visual C++ User - Compiler Problems Pin
David Crow3-Aug-09 7:49
David Crow3-Aug-09 7:49 

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.