Click here to Skip to main content
16,011,436 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVC++:CAsyncSocket and SDI Pin
crasher7-Mar-02 3:09
crasher7-Mar-02 3:09 
GeneralRe: VC++:CAsyncSocket and SDI Pin
RobJones7-Mar-02 4:11
RobJones7-Mar-02 4:11 
GeneralRe: VC++:CAsyncSocket and SDI Pin
fara7-Mar-02 13:59
fara7-Mar-02 13:59 
GeneralRe: VC++:CAsyncSocket and SDI Pin
lucy7-Mar-02 4:13
lucy7-Mar-02 4:13 
QuestionHow to deal with a Word document? Pin
big20027-Mar-02 3:05
big20027-Mar-02 3:05 
AnswerRe: How to deal with a Word document? Pin
Carlos Antollini7-Mar-02 3:22
Carlos Antollini7-Mar-02 3:22 
Generalpacking bytes to form an int (32bit) Pin
Merle Pittman7-Mar-02 2:36
Merle Pittman7-Mar-02 2:36 
GeneralRe: packing bytes to form an int (32bit) Pin
Jon Hulatt7-Mar-02 2:51
Jon Hulatt7-Mar-02 2:51 
I would expect that the quickest way is this:

char l,h; // from your serial port
DWORD dwValue = 0; // init to 0

dwValue= ((DWORD) h) << 8;
dwValue+=l;


of course, you could do that on one line if you liked. But, the point is that an ADD operation is going to be quicker than an OR. if you init your DWORD to 0, then the add and or are identical in their result anyway.

However, I wouldn't be very worried about speed here. Your data is coming from a serial port, and serial ports ain't that quick. So long as your CPU is faster than an 8088, you'll probably keep up however you do it.

Jon

Sorry to dissapoint you all with my lack of a witty or poignant signature.
GeneralRe: packing bytes to form an int (32bit) Pin
Tomasz Sowinski7-Mar-02 2:50
Tomasz Sowinski7-Mar-02 2:50 
Generaldrive list, drive type and drive name Pin
Guy Lecomte7-Mar-02 2:27
Guy Lecomte7-Mar-02 2:27 
GeneralRe: drive list, drive type and drive name Pin
Tomasz Sowinski7-Mar-02 2:28
Tomasz Sowinski7-Mar-02 2:28 
GeneralRe: drive list, drive type and drive name Pin
Atul Dharne7-Mar-02 2:48
Atul Dharne7-Mar-02 2:48 
GeneralParsing MS Word file Pin
7-Mar-02 2:21
suss7-Mar-02 2:21 
GeneralRe: Parsing MS Word file Pin
Michael P Butler7-Mar-02 2:39
Michael P Butler7-Mar-02 2:39 
GeneralRe: Parsing MS Word file Pin
Atul Dharne7-Mar-02 3:05
Atul Dharne7-Mar-02 3:05 
GeneralRe: Parsing MS Word file Pin
8-Mar-02 0:00
suss8-Mar-02 0:00 
GeneralRe: Parsing MS Word file Pin
Carlos Antollini7-Mar-02 3:28
Carlos Antollini7-Mar-02 3:28 
GeneralRe: Parsing MS Word file Pin
Mike Nordell7-Mar-02 8:42
Mike Nordell7-Mar-02 8:42 
GeneralParsing MS Word file Pin
7-Mar-02 2:17
suss7-Mar-02 2:17 
GeneralThread problem.. Pin
Neha7-Mar-02 2:08
Neha7-Mar-02 2:08 
GeneralRe: Thread problem.. Pin
Tomasz Sowinski7-Mar-02 2:14
Tomasz Sowinski7-Mar-02 2:14 
GeneralRe: Thread problem.. Pin
Tim Smith7-Mar-02 2:20
Tim Smith7-Mar-02 2:20 
GeneralRe: Thread problem.. Pin
Neha7-Mar-02 2:45
Neha7-Mar-02 2:45 
GeneralRe: Thread problem.. Pin
Tomasz Sowinski7-Mar-02 2:56
Tomasz Sowinski7-Mar-02 2:56 
GeneralRe: Thread problem.. Pin
Neha7-Mar-02 17:56
Neha7-Mar-02 17:56 

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.