Click here to Skip to main content
15,896,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionError using MCIWnd to play FLV and MP4 videos Pin
Ha_Tim2-Nov-09 2:14
Ha_Tim2-Nov-09 2:14 
QuestionInitializing array with a runtime value. Pin
yeah10002-Nov-09 2:10
yeah10002-Nov-09 2:10 
AnswerRe: Initializing array with a runtime value. Pin
David Crow2-Nov-09 2:20
David Crow2-Nov-09 2:20 
AnswerRe: Initializing array with a runtime value. Pin
Michael Schubert2-Nov-09 3:22
Michael Schubert2-Nov-09 3:22 
QuestionLoading exe into memory from DVD Pin
kumar sanghvi1-Nov-09 23:52
kumar sanghvi1-Nov-09 23:52 
AnswerRe: Loading exe into memory from DVD Pin
Randor 2-Nov-09 0:12
professional Randor 2-Nov-09 0:12 
AnswerRe: Loading exe into memory from DVD Pin
«_Superman_»2-Nov-09 7:11
professional«_Superman_»2-Nov-09 7:11 
QuestionSending binary file through Sockets in WindowsXP Pin
WindowsVsLinux1-Nov-09 23:29
WindowsVsLinux1-Nov-09 23:29 
Hi,
I want to send binary file through Sockets in WindowsXP from server to client.My code is-

client:
hFile=CreateFileA(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
if (hFile == NULL || hFile == INVALID_HANDLE_VALUE)
{
hFile = NULL;
}
for (i=0 ; ; )
{
j=recv(sock, buf, sizeof(buf), 0);
printf("\n\treceiving file...plz wait.");
if (j <= 0)
break;
i += j;
WriteFile(hFile, buf, j, &dw, 0);
}
CloseHandle(hFile);
printf("\n\tfile received sucessfully");

server:
fp=fopen(pathoffile,"rb");
if(fp==NULL)
{
printf("\ncann't open file");
}
for (i=0, endoffile=0 ; ; )
{
j = fread(buf, 1, sizeof(buf), fp);
if (j < 0)
{
}
if (j == 0)
{
endoffile = 1;
}
j=send(TheClient, buf, j, 0);
}
The code is compiled properly but when i want to receive any file.the file received sucessfully.I was thinking that it should be printed on client computer "file received sucessfully" but it is printed only when i close my server.When the server is executing at the receving time it is printed "receiving file...plz wait." yet the file already sucessfully received on client side.
AnswerRe: Sending binary file through Sockets in WindowsXP Pin
Richard MacCutchan1-Nov-09 23:44
mveRichard MacCutchan1-Nov-09 23:44 
GeneralRe: Sending binary file through Sockets in WindowsXP Pin
WindowsVsLinux2-Nov-09 2:16
WindowsVsLinux2-Nov-09 2:16 
GeneralRe: Sending binary file through Sockets in WindowsXP Pin
WindowsVsLinux2-Nov-09 7:24
WindowsVsLinux2-Nov-09 7:24 
GeneralRe: Sending binary file through Sockets in WindowsXP Pin
Richard MacCutchan2-Nov-09 7:40
mveRichard MacCutchan2-Nov-09 7:40 
GeneralRe: Sending binary file through Sockets in WindowsXP Pin
WindowsVsLinux2-Nov-09 7:34
WindowsVsLinux2-Nov-09 7:34 
AnswerRe: Sending binary file through Sockets in WindowsXP Pin
CPallini1-Nov-09 23:49
mveCPallini1-Nov-09 23:49 
AnswerRe: Sending binary file through Sockets in WindowsXP Pin
KarstenK2-Nov-09 0:06
mveKarstenK2-Nov-09 0:06 
QuestionHow to clear all the elements of an char array Pin
WindowsVsLinux1-Nov-09 23:16
WindowsVsLinux1-Nov-09 23:16 
AnswerRe: How to clear all the elements of an char array Pin
CPallini1-Nov-09 23:36
mveCPallini1-Nov-09 23:36 
AnswerRe: How to clear all the elements of an char array Pin
Rajesh R Subramanian1-Nov-09 23:49
professionalRajesh R Subramanian1-Nov-09 23:49 
AnswerRe: How to clear all the elements of an char array Pin
KarstenK2-Nov-09 0:08
mveKarstenK2-Nov-09 0:08 
GeneralRe: How to clear all the elements of an char array Pin
CPallini2-Nov-09 0:15
mveCPallini2-Nov-09 0:15 
JokeRe: How to clear all the elements of an char array Pin
Randor 2-Nov-09 0:20
professional Randor 2-Nov-09 0:20 
JokeRe: How to clear all the elements of an char array Pin
CPallini2-Nov-09 0:27
mveCPallini2-Nov-09 0:27 
JokeRe: How to clear all the elements of an char array Pin
Randor 2-Nov-09 0:41
professional Randor 2-Nov-09 0:41 
QuestionA referral was returned from the server.?? Pin
Kushagra Tiwari1-Nov-09 23:11
Kushagra Tiwari1-Nov-09 23:11 
QuestionRe: A referral was returned from the server.?? Pin
Randor 1-Nov-09 23:32
professional Randor 1-Nov-09 23:32 

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.