Click here to Skip to main content
16,010,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reading and Writing to a file at the same time Pin
kakan15-May-06 23:31
professionalkakan15-May-06 23:31 
GeneralRe: Reading and Writing to a file at the same time Pin
waxie16-May-06 0:30
waxie16-May-06 0:30 
GeneralRe: Reading and Writing to a file at the same time Pin
kakan16-May-06 0:50
professionalkakan16-May-06 0:50 
GeneralRe: Reading and Writing to a file at the same time Pin
Naveen15-May-06 22:37
Naveen15-May-06 22:37 
QuestionRe: Reading and Writing to a file at the same time Pin
David Crow16-May-06 3:06
David Crow16-May-06 3:06 
AnswerRe: Reading and Writing to a file at the same time Pin
kakan15-May-06 21:58
professionalkakan15-May-06 21:58 
QuestionImage transwering using CAsyncsoc Pin
psramu15-May-06 21:01
psramu15-May-06 21:01 
AnswerRe: Image transwering using CAsyncsoc Pin
kakan15-May-06 22:16
professionalkakan15-May-06 22:16 
There are several ways. An easy way could be by sending i.e. an unsigned long (if has the capacity needed) as the first data.

Kind of like this:
Sending side
<br />
unsigned long datalength = imageLength;<br />
Send(&datalength, sizeof(unsigned long));<br />
while(moreDataToSend) {<br />
  send(data);<br />
}<br />


At the receiving side (assuming that the Read function returns the number of bytes read from the socket):
<br />
unsigned long receivedDataLength;<br />
Read(&receivedDataLength, sizeof(unsigned long));<br />
<br />
unsigned long receivedBytes = 0L;<br />
<br />
while(receivedBytes < receivedDataLength) {<br />
  receivedBytes += (unsigned long) Read(buffer, sizeof(buffer);<br />
  // Do something with buffer<br />
}<br />


If an unsigned long isn't enough, the use some other variable type. Just make sure it's the same on both sides.
QuestionAddition MultiDocument/View architecture to ActiveX Pin
majco33315-May-06 20:39
majco33315-May-06 20:39 
AnswerRe: Addition MultiDocument/View architecture to ActiveX Pin
Roger Stoltz16-May-06 9:27
Roger Stoltz16-May-06 9:27 
QuestionAm I doing wrong? Pin
ppatel56715-May-06 20:31
ppatel56715-May-06 20:31 
AnswerRe: Am I doing wrong? Pin
Michael Dunn15-May-06 21:17
sitebuilderMichael Dunn15-May-06 21:17 
GeneralRe: Am I doing wrong? Pin
ppatel56715-May-06 21:20
ppatel56715-May-06 21:20 
GeneralRe: Am I doing wrong? Pin
Stephen Hewitt15-May-06 22:03
Stephen Hewitt15-May-06 22:03 
GeneralRe: Am I doing wrong? Pin
Hamid_RT15-May-06 22:44
Hamid_RT15-May-06 22:44 
GeneralRe: Am I doing wrong? Pin
Stephen Hewitt15-May-06 23:58
Stephen Hewitt15-May-06 23:58 
QuestionGetting the number of records in a recordset Pin
SWDevil15-May-06 20:26
SWDevil15-May-06 20:26 
AnswerRe: Getting the number of records in a recordset Pin
Monty215-May-06 20:30
Monty215-May-06 20:30 
GeneralRe: Getting the number of records in a recordset Pin
SWDevil15-May-06 20:42
SWDevil15-May-06 20:42 
GeneralRe: Getting the number of records in a recordset Pin
psramu15-May-06 21:05
psramu15-May-06 21:05 
GeneralRe: Getting the number of records in a recordset Pin
SWDevil15-May-06 21:34
SWDevil15-May-06 21:34 
GeneralRe: Getting the number of records in a recordset Pin
David Crow16-May-06 2:46
David Crow16-May-06 2:46 
GeneralRe: Getting the number of records in a recordset Pin
SWDevil16-May-06 3:23
SWDevil16-May-06 3:23 
QuestionRe: Getting the number of records in a recordset Pin
David Crow16-May-06 4:30
David Crow16-May-06 4:30 
AnswerRe: Getting the number of records in a recordset Pin
SWDevil16-May-06 19:35
SWDevil16-May-06 19:35 

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.