|
Thanks Mike, but that's undname, not Depends.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi friends,
i'm reading one "character" at time from RS-232 interface and storing it in a character array.I'd like to know whether any in-built functions are there to convert this "single character" into its ASCII hexadecimal eqivalent??
Thanks in Advance...
Rajeev
|
|
|
|
|
rajeev82 wrote: in-built functions are there to convert this "single character" into its ASCII hexadecimal eqivalent??
Hexadecimal equivalent is not something very clear. What do you want to do ? Print this value in a string (using its hexa representation) ?
If yes, you can use printf with the 'x' tag:
char szString[50];
char Temp = 'A';
sprintf(szString,"%x",Temp);
Because a number is neither hexa, decimal nor binary, it's just its representation that can change.
EDIT: changed printf to sprintf, thanks David
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
rajeev82 wrote: ...are there to convert this "single character" into its ASCII hexadecimal eqivalent??
For what purpose? Usually when someone talks of converting from base-10 to base-16, it is for display purposes. When a number is stored, its base is irrelevant. In other words, 123, 0x7b, and 1111011 all represent the same number.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I was about to ask if you are working for the company I use to work for (the only one I know that uses RS-232 and transmits data at twice its size), but then I saw you are in India ...
Anyway, to answer your question:
To convert a number to a text-readable ASCII-Hex representation (that is, each half of a byte is represented by a single hexadecimal character [0-9aA-fF]), use the printf family:
char buffer[100] = {0};<br />
BYTE myInfo = 64;<br />
sprintf(buffer, "%X", myInfo);
To convert an ASCII-Hex number back to a byte, use sscanf:
char* buffer = "AB";<br />
BYTE myInfo = 0;<br />
sscanf(buffer, "%2.2X", &MyInfo);
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Perhaps this helps?
BYTE HexToByte(LPCSTR cpHex)
{
BYTE cRetVal;
if (*cpHex < 58)
cRetVal = *cpHex - '0';
else
cRetVal = *cpHex - '7';
cRetVal <<= 4;
cpHex++;
if (*cpHex < 58)
cRetVal += *cpHex - '0';
else
cRetVal += *cpHex - '7';
return cRetVal;
}
onwards and upwards...
|
|
|
|
|
Hi ,,
I need to disable the maximise button of the window..
Please guide me about this...
Manjunath S
|
|
|
|
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style ^= WS_MAXIMIZEBOX;
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
Regards
Amar
|
|
|
|
|
CMenu* pSysMenu = GetSystemMenu(FALSE);
pSysMenu->ModifyMenu(SC_CLOSE,MF_BYCOMMAND | MF_GRAYED );
pSysMenu->ModifyMenu(SC_MAXIMIZE,MF_BYCOMMAND | MF_GRAYED );
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
-- modified at 10:10 Thursday 8th June, 2006
|
|
|
|
|
Sorry the code is not working for maximize button
its fairly working with close button
U can add
ModifyStyle(WS_MAXIMIZEBOX,0);
or remove maximize button by
ModifyStyle(0,WS_MAXIMIZEBOX);
u can see the disable maximize button, if teh minimize button is also present, else it will hide the maximize button disabling.
I think that is the default windows behaviour.
I donno how to change it
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
yes this code work for SC_CLOSE not maximize
whitesky
|
|
|
|
|
Hi,
Does leadtool or objective toolkit or freeimage support conversion to Jpeg(with CMYK color model).
Thanks
|
|
|
|
|
|
hi
anyone have idea abt sipxtapi.
if yes plz let me know.
i have some query but i didn't find any concrened person.
thanking u
|
|
|
|
|
Did this not help?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi
thanx for sending me such a valuable link.
but i have already gothrough this documentation.
still i have some query.....
could u help me?
waiting for ur reply.
|
|
|
|
|
aavesh wrote: could u help me?
You've not asked a specific question. Are we supposed to read your mind?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
no its not like that....
My question is:
i'm making aproject in vc++ using sipxtapi technology.
My phone is ringing when i put the required information.
1 . when phone rings i want ot disconnect it or stop ringiing the phone.
2. How to accept the call and i want ot detect the caller number & want to show in the text box.
Thanx
|
|
|
|
|
SeeHere[^]i think its good for you
whitesky
|
|
|
|
|
thanx for the link..
My question is:
i'm making aproject in vc++ using sipxtapi technology.
My phone is ringing when i put the required information.
1 . when phone rings i want ot disconnect it or stop ringiing the phone.
2. How to accept the call and i want ot detect the caller number & want to show in the text box.
Thanx
|
|
|
|
|
i have an xml file and dll file of some other application.how to load the MFC controls style and properties from xml file and calling functionalities of the corresponding controls from dll
|
|
|
|
|
raghuji.rao wrote: how to load the MFC controls style and properties from xml file
The only way I'm aware of, is to read the XML file yourself and then create the controls at run-time depending of what you read from the file. To parse the XML file, you can perhaps use TinyXML[^] which is quite powerfull.
raghuji.rao wrote: and calling functionalities of the corresponding controls from dll
I don't understand what you are trying to achieve. Could you be more specific ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
i have downloaded an user interface application from codejock.com. it has a very good gui. he is importing control properties from an xml file and calling control functionalites from a dll. i want to have in my application. how to do that?
|
|
|
|
|
Impossible to say without knowing what technologies he is using.
Does he uses MFC ? Or is it a special GUI ?
I think the easier is to ask directly to the guy who developped this thing (or at least provide a link to what you are talking about).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
he is supplying exe and related dll,xml file. am sure it is mfc dll
|
|
|
|