Click here to Skip to main content
15,912,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHelp me description of class CXmlFile ! Pin
vnsoftware28-Apr-06 17:32
vnsoftware28-Apr-06 17:32 
AnswerRe: Help me description of class CXmlFile ! Pin
chybin28-Apr-06 21:36
chybin28-Apr-06 21:36 
GeneralRe: Help me description of class CXmlFile ! Pin
vnsoftware1-May-06 2:58
vnsoftware1-May-06 2:58 
Questionusing shockwave flash in dialog box Pin
chybin28-Apr-06 16:16
chybin28-Apr-06 16:16 
Questionhex to char Pin
borono28-Apr-06 13:03
borono28-Apr-06 13:03 
AnswerRe: hex to char Pin
cmk28-Apr-06 14:22
cmk28-Apr-06 14:22 
GeneralRe: hex to char Pin
borono28-Apr-06 14:44
borono28-Apr-06 14:44 
GeneralRe: hex to char Pin
cmk28-Apr-06 16:27
cmk28-Apr-06 16:27 
borono wrote:
Why add 4 to it and then together


You don't add 4, you shift left 4 bits.

borono wrote:
I don't like that I have to split the value


I gave the code i did to give you a low-level understanding of what is happening.
As others have pointed out in other threads you can also use strtol or sscanf.

I am assuming the hex is in a string e.g. "F012".
As such just loop through the hex string 2 char at a time.

e.g. something like
void  HexToStr( cchar *HEX, char *STR )
{
    for( ulong i = 0, j = 0;  HEX[i] && HEX[i+1];  i+=2, j++ ) {
      STR[j] = (char)FkHex2ByteA(HEX[i], HEX[i+1]);
    }
}

... of course you would
- add HEX/STR buffer lengths as function param
- do proper error checking
- do more validation that HEX actually contains hex string
- ...



...cmk

Save the whales - collect the whole set
GeneralRe: hex to char Pin
borono28-Apr-06 16:58
borono28-Apr-06 16:58 
AnswerRe: hex to char Pin
Stephen Hewitt29-Apr-06 0:41
Stephen Hewitt29-Apr-06 0:41 
GeneralRe: hex to char Pin
borono29-Apr-06 11:37
borono29-Apr-06 11:37 
AnswerRe: hex to char Pin
Ryan Binns29-Apr-06 4:29
Ryan Binns29-Apr-06 4:29 
QuestionI need something about CButton Pin
vaskodrenoski28-Apr-06 12:23
vaskodrenoski28-Apr-06 12:23 
GeneralRe: I need something about CButton Pin
Laxman Auti28-Apr-06 18:27
Laxman Auti28-Apr-06 18:27 
AnswerRe: I need something about CButton Pin
Hamid_RT28-Apr-06 19:04
Hamid_RT28-Apr-06 19:04 
QuestionCButtonST bug, any fix? Pin
GrumbleWeedster28-Apr-06 11:27
GrumbleWeedster28-Apr-06 11:27 
AnswerRe: CButtonST bug, any fix? Pin
Rob Caldecott28-Apr-06 13:22
Rob Caldecott28-Apr-06 13:22 
QuestionPlatform SDK - Feb 2003 Pin
khb28-Apr-06 11:06
khb28-Apr-06 11:06 
AnswerRe: Platform SDK - Feb 2003 Pin
ThatsAlok28-Apr-06 23:32
ThatsAlok28-Apr-06 23:32 
QuestionRe: Platform SDK - Feb 2003 Pin
khb29-Apr-06 0:29
khb29-Apr-06 0:29 
QuestionConversion from Visual studio 6 to VC 2005 Pin
nahitan28-Apr-06 10:01
nahitan28-Apr-06 10:01 
AnswerRe: Conversion from Visual studio 6 to VC 2005 Pin
Nish Nishant28-Apr-06 10:19
sitebuilderNish Nishant28-Apr-06 10:19 
GeneralRe: Conversion from Visual studio 6 to VC 2005 Pin
nahitan1-May-06 3:22
nahitan1-May-06 3:22 
AnswerRe: Conversion from Visual studio 6 to VC 2005 Pin
Hamid_RT28-Apr-06 18:37
Hamid_RT28-Apr-06 18:37 
GeneralRe: Conversion from Visual studio 6 to VC 2005 Pin
nahitan1-May-06 3:22
nahitan1-May-06 3:22 

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.