Click here to Skip to main content
15,922,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: string Pin
macmac3823-Apr-04 2:26
macmac3823-Apr-04 2:26 
GeneralRe: string Pin
David Crow23-Apr-04 3:35
David Crow23-Apr-04 3:35 
GeneralRe: string Pin
macmac3823-Apr-04 3:55
macmac3823-Apr-04 3:55 
GeneralRe: string Pin
David Crow23-Apr-04 4:15
David Crow23-Apr-04 4:15 
GeneralRe: string Pin
macmac3823-Apr-04 5:01
macmac3823-Apr-04 5:01 
GeneralRe: string Pin
David Crow23-Apr-04 5:26
David Crow23-Apr-04 5:26 
GeneralRe: string Pin
macmac3823-Apr-04 6:17
macmac3823-Apr-04 6:17 
GeneralRe: string Pin
David Crow23-Apr-04 6:40
David Crow23-Apr-04 6:40 
macmac38 wrote:
TRACE( "Bytes read: %d",dwBytesRead);

Since dwBytesRead is a DWORD, you'll need to use the %lu format.

Nonetheless, if received[] is only 40 bytes, trying to access the -858993460th position, or any value outside of 0-39, is obviously wrong. Check the return value of Read() beforehand.

In your original post, you indicated that 58 characters were being sent to the serial port. You'll need room for that plus one more so received[] should be 59 not 40. This is not the root of the problem, however, but will eventually need to be addressed.


"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)


GeneralRe: string Pin
macmac3825-Apr-04 22:47
macmac3825-Apr-04 22:47 
GeneralRe: string Pin
David Crow26-Apr-04 2:18
David Crow26-Apr-04 2:18 
GeneralRe: string Pin
macmac3826-Apr-04 2:25
macmac3826-Apr-04 2:25 
GeneralRe: string Pin
David Crow26-Apr-04 2:31
David Crow26-Apr-04 2:31 
Generalcustom resource problem Pin
chocm20-Apr-04 23:36
chocm20-Apr-04 23:36 
GeneralRe: custom resource problem Pin
David Crow21-Apr-04 2:52
David Crow21-Apr-04 2:52 
GeneralRe: custom resource problem Pin
chocm21-Apr-04 18:46
chocm21-Apr-04 18:46 
GeneralRe: custom resource problem Pin
David Crow22-Apr-04 2:05
David Crow22-Apr-04 2:05 
GeneralRe: custom resource problem Pin
chocm22-Apr-04 18:26
chocm22-Apr-04 18:26 
GeneralRe: custom resource problem Pin
David Crow23-Apr-04 2:08
David Crow23-Apr-04 2:08 
GeneralRe: custom resource problem Pin
chocm24-Apr-04 23:20
chocm24-Apr-04 23:20 
GeneralRe: custom resource problem Pin
David Crow26-Apr-04 2:20
David Crow26-Apr-04 2:20 
QuestionHow to scroll CListView down ? Pin
vgrigor20-Apr-04 23:26
vgrigor20-Apr-04 23:26 
AnswerRe: How to scroll CListView down ? Pin
jmkhael21-Apr-04 0:06
jmkhael21-Apr-04 0:06 
Generalaudio file proprties Pin
viliam20-Apr-04 23:08
viliam20-Apr-04 23:08 
GeneralIME caret - asian systems Pin
Roger Alsing20-Apr-04 23:06
Roger Alsing20-Apr-04 23:06 
Generalhide cursor Pin
kaldoklv20-Apr-04 23:01
kaldoklv20-Apr-04 23:01 

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.