Click here to Skip to main content
15,892,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSleep() Pin
anilaabc26-Nov-08 18:23
anilaabc26-Nov-08 18:23 
AnswerRe: Sleep() Pin
_AnsHUMAN_ 26-Nov-08 18:36
_AnsHUMAN_ 26-Nov-08 18:36 
AnswerRe: Sleep() Pin
ThatsAlok26-Nov-08 19:31
ThatsAlok26-Nov-08 19:31 
AnswerRe: Sleep() Pin
CPallini26-Nov-08 21:08
mveCPallini26-Nov-08 21:08 
AnswerRe: Sleep() Pin
Jijo.Raj26-Nov-08 21:22
Jijo.Raj26-Nov-08 21:22 
QuestionSleep() blacken the screen Pin
220826-Nov-08 18:19
220826-Nov-08 18:19 
QuestionConvert lpbyte* to Hex String (Unicode) Pin
silentandromeda26-Nov-08 18:15
silentandromeda26-Nov-08 18:15 
AnswerRe: Convert lpbyte* to Hex String (Unicode) Pin
CPallini26-Nov-08 22:20
mveCPallini26-Nov-08 22:20 
There is (the generic text mapping version of) sprintf for that, for instance

BYTE pb[]={0x46, 0x4F, 0x4F};
const int SIZE = sizeof(pb)/sizeof(pb[0]);
TCHAR *psz = new TCHAR[2*SIZE+1];
int i;

for (i=0; i<size;> {
  _stprintf(psz+2*i, _T("%02x"), pb[i]);
}
psz[2*i]=_T('\0');



BTW the generic text version of your function is

// where pszCharArr is declared as TCHAR *

  DWORD j =0;
  for (i = 0; i < dwSizeOfStrBuf ; i++)
  {
    BYTE b = lpb[i];
    BYTE b0 = (b>>4) & 0x0F;
    BYTE b1 = b & 0x0F;
     if((0<= b0) && (b0 <= 9))
          pszCharArr[j] = _T('0') + b0;
     else
          pszCharArr[j] = _T('A') + (b0 - 10);
     j++;
     if((0<= b1) && (b1 <= 9))
          pszCharArr[j] = _T('0') + b1;
     else
          pszCharArr[j] = _T('A') + (b1 - 10);
     j++;
}
pszCharArr[j] = _T('\0');



Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: Convert lpbyte* to Hex String (Unicode) Pin
silentandromeda28-Nov-08 15:54
silentandromeda28-Nov-08 15:54 
QuestionHaving difficulty writing text on a bitmap Pin
JJeffrey26-Nov-08 16:19
JJeffrey26-Nov-08 16:19 
AnswerRe: Having difficulty writing text on a bitmap [modified] Pin
enhzflep26-Nov-08 17:26
enhzflep26-Nov-08 17:26 
GeneralRe: Having difficulty writing text on a bitmap Pin
JJeffrey26-Nov-08 19:35
JJeffrey26-Nov-08 19:35 
GeneralRe: Having difficulty writing text on a bitmap Pin
enhzflep26-Nov-08 19:48
enhzflep26-Nov-08 19:48 
GeneralRe: Having difficulty writing text on a bitmap Pin
JJeffrey26-Nov-08 20:52
JJeffrey26-Nov-08 20:52 
GeneralRe: Having difficulty writing text on a bitmap Pin
enhzflep26-Nov-08 21:04
enhzflep26-Nov-08 21:04 
GeneralRe: Having difficulty writing text on a bitmap Pin
JJeffrey26-Nov-08 21:37
JJeffrey26-Nov-08 21:37 
GeneralRe: Having difficulty writing text on a bitmap Pin
PJ Arends27-Nov-08 7:13
professionalPJ Arends27-Nov-08 7:13 
GeneralRe: Having difficulty writing text on a bitmap [modified] Pin
JJeffrey27-Nov-08 15:49
JJeffrey27-Nov-08 15:49 
QuestionCursor not changing [modified] Pin
Leslie Sanford26-Nov-08 9:00
Leslie Sanford26-Nov-08 9:00 
AnswerRe: Cursor not changing Pin
CPallini26-Nov-08 9:30
mveCPallini26-Nov-08 9:30 
GeneralRe: Cursor not changing Pin
Leslie Sanford26-Nov-08 10:06
Leslie Sanford26-Nov-08 10:06 
GeneralRe: Cursor not changing Pin
CPallini26-Nov-08 10:17
mveCPallini26-Nov-08 10:17 
Question<tag>/, source code questions</tag> Pin
ForNow26-Nov-08 6:26
ForNow26-Nov-08 6:26 
AnswerRe: /, source code questions Pin
Maximilien26-Nov-08 6:52
Maximilien26-Nov-08 6:52 
GeneralRe: /, source code questions Pin
jeron126-Nov-08 7:16
jeron126-Nov-08 7:16 

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.