Click here to Skip to main content
15,914,074 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Closing an application while it is still busy Pin
Naveen28-Jul-06 1:58
Naveen28-Jul-06 1:58 
AnswerRe: Closing an application while it is still busy Pin
Cedric Moonen28-Jul-06 2:00
Cedric Moonen28-Jul-06 2:00 
GeneralRe: Closing an application while it is still busy Pin
cv_k3n28-Jul-06 4:21
cv_k3n28-Jul-06 4:21 
GeneralRe: Closing an application while it is still busy Pin
Eytukan28-Jul-06 7:47
Eytukan28-Jul-06 7:47 
GeneralRe: Closing an application while it is still busy Pin
cv_k3n28-Jul-06 17:03
cv_k3n28-Jul-06 17:03 
QuestionRe: Closing an application while it is still busy Pin
David Crow28-Jul-06 5:00
David Crow28-Jul-06 5:00 
Questiondynamically allocted array question Pin
kitty528-Jul-06 1:22
kitty528-Jul-06 1:22 
AnswerRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:31
Cedric Moonen28-Jul-06 1:31 
kitty5 wrote:
1) So, I pass in the *buff. ReadFile() will dump the data there.
If I do another ReadFile() will it append to the end of *buff?
OR, will it overlap the data already in the *buff, if so,
how do I make subsequent writes into *buff append to the end of it?


No, it copy the data at the address you pass to the function, which is the begining of your array. If you want to append it, you'll have to increment the address (something like buff+Offset). But warning !! As your buffer is a ULONG, it means that a single increment will point to the next ULONG (so 4 bytes further). It is not a good idea in this case to use a pointer to ULONG, use a pointer to UCHAR instead so you don't have to cast the pointer to a char area in order to be able to increment only one byte.
Remember that ReadFile read data un bytes, so it can read only 3 bytes for example (and there you got the problem because it is not a multiple of 4)


kitty5 wrote:
2) Does ReadFile() automatically stick each 32-bit word out of the 1024 words it reads into each of the individual array slot of buff? So, that there will be a total of 256 array elements after the 1st call to ReadFile().


ReadFile is supposed to read bytes, so it has nothing to do with 32-bit words.

kitty5 wrote:
3) If "DWORD nNumberOfBytesToRead" is the min number of bytes to read, will
ReadFile() read more bytes if they are available? If so, how can you
limit ReadFile to only read the specified number of bytes?


No, it is the number of bytes to read. The function won't read more bytes (yup, I checked MSDN and that's strange they say minimum instead of maximum Unsure | :~ )


Cédric Moonen
Software developer

Charting control

GeneralRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:39
Steen Krogsgaard28-Jul-06 1:39 
GeneralRe: dynamically allocted array question Pin
kitty528-Jul-06 2:08
kitty528-Jul-06 2:08 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 2:15
Cedric Moonen28-Jul-06 2:15 
GeneralRe: dynamically allocted array question Pin
kitty528-Jul-06 2:26
kitty528-Jul-06 2:26 
AnswerRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:39
Steen Krogsgaard28-Jul-06 1:39 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:44
Cedric Moonen28-Jul-06 1:44 
GeneralRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:52
Steen Krogsgaard28-Jul-06 1:52 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:55
Cedric Moonen28-Jul-06 1:55 
AnswerRe: dynamically allocted array question Pin
Zac Howland28-Jul-06 4:58
Zac Howland28-Jul-06 4:58 
QuestionList Control Help need it........................................ Pin
konstantinos_100028-Jul-06 1:08
konstantinos_100028-Jul-06 1:08 
AnswerRe: List Control Help need it........................................ Pin
Naveen28-Jul-06 1:29
Naveen28-Jul-06 1:29 
GeneralRe: List Control Help need it........................................ Pin
konstantinos_100028-Jul-06 5:22
konstantinos_100028-Jul-06 5:22 
GeneralRe: List Control Help need it........................................ Pin
Naveen28-Jul-06 18:47
Naveen28-Jul-06 18:47 
QuestionRe: List Control Help need it........................................ Pin
Hamid_RT28-Jul-06 1:50
Hamid_RT28-Jul-06 1:50 
AnswerRe: List Control Help need it........................................ Pin
konstantinos_100028-Jul-06 2:31
konstantinos_100028-Jul-06 2:31 
GeneralRe: List Control Help need it Pin
Hamid_RT28-Jul-06 3:41
Hamid_RT28-Jul-06 3:41 
GeneralRe: List Control Help need it Pin
konstantinos_100028-Jul-06 5:23
konstantinos_100028-Jul-06 5:23 

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.