Click here to Skip to main content
16,005,389 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function templates in classes Pin
Maxwell Chen22-Apr-04 23:55
Maxwell Chen22-Apr-04 23:55 
GeneralRe: Function templates in classes Pin
toxcct23-Apr-04 0:35
toxcct23-Apr-04 0:35 
GeneralRe: Function templates in classes Pin
Mike Dimmick23-Apr-04 2:14
Mike Dimmick23-Apr-04 2:14 
GeneralConverting short to array of bytes Pin
Anonymous22-Apr-04 21:36
Anonymous22-Apr-04 21:36 
GeneralRe: Converting short to array of bytes Pin
toxcct22-Apr-04 21:43
toxcct22-Apr-04 21:43 
GeneralRe: Converting short to array of bytes Pin
Anonymous22-Apr-04 21:49
Anonymous22-Apr-04 21:49 
GeneralRe: Converting short to array of bytes Pin
Maxwell Chen22-Apr-04 21:50
Maxwell Chen22-Apr-04 21:50 
GeneralRe: Converting short to array of bytes Pin
Dominik Reichl22-Apr-04 21:55
Dominik Reichl22-Apr-04 21:55 
Simple:

short shValue;<br />
unsigned char byteArray[2];<br />
<br />
memcpy(byteArray, &shValue, 2);<br />
<br />
// To extract them again:<br />
memcpy(&shValue, byteArray, 2);


But note that this code doesn't handle endianess correctly. If you want to handle endianess you must swap the two bytes on one (and only one!) system.

Best regards,
Dominik



_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? Wink | ;)
(doesn't work on NT)

GeneralRe: Converting short to array of bytes Pin
Anonymous22-Apr-04 22:13
Anonymous22-Apr-04 22:13 
GeneralRe: Converting short to array of bytes Pin
Mike Dimmick23-Apr-04 2:18
Mike Dimmick23-Apr-04 2:18 
Questionhow to get currently selected Bitmap's ID or reource no? Pin
sugumar22-Apr-04 21:32
sugumar22-Apr-04 21:32 
AnswerRe: how to get currently selected Bitmap's ID or reource no? Pin
Monty222-Apr-04 21:37
Monty222-Apr-04 21:37 
QuestionHow to use non-system fonts for dialog,button,etc... Pin
Truong D. Toan22-Apr-04 20:30
Truong D. Toan22-Apr-04 20:30 
AnswerRe: How to use non-system fonts for dialog,button,etc... Pin
Monty222-Apr-04 21:41
Monty222-Apr-04 21:41 
GeneralRe: How to use non-system fonts for dialog,button,etc... Pin
Truong D. Toan25-Apr-04 8:00
Truong D. Toan25-Apr-04 8:00 
Generalserial comm in w2k (please help!!!) Pin
фил22-Apr-04 19:42
фил22-Apr-04 19:42 
GeneralRe: serial comm in w2k (please help!!!) Pin
D.J.Deky22-Apr-04 21:07
D.J.Deky22-Apr-04 21:07 
GeneralRe: serial comm in w2k (please help!!!) Pin
фил22-Apr-04 21:33
фил22-Apr-04 21:33 
GeneralRe: serial comm in w2k (please help!!!) Pin
D.J.Deky22-Apr-04 22:13
D.J.Deky22-Apr-04 22:13 
GeneralRe: serial comm in w2k (please help!!!) Pin
фил22-Apr-04 22:24
фил22-Apr-04 22:24 
GeneralRe: serial comm in w2k (please help!!!) Pin
Anonymous22-Apr-04 23:26
Anonymous22-Apr-04 23:26 
GeneralRe: serial comm in w2k (please help!!!) Pin
hasanshik22-Apr-04 23:27
susshasanshik22-Apr-04 23:27 
GeneralRe: serial comm in w2k (please help!!!) Pin
jhwurmbach23-Apr-04 1:39
jhwurmbach23-Apr-04 1:39 
GeneralRe: serial comm in w2k (please help!!!) Pin
фил23-Apr-04 1:48
фил23-Apr-04 1:48 
GeneralRe: serial comm in w2k (please help!!!) Pin
toxcct22-Apr-04 21:08
toxcct22-Apr-04 21:08 

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.