Click here to Skip to main content
15,890,399 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory Management with variables Pin
Mike Dimmick18-Jan-04 23:27
Mike Dimmick18-Jan-04 23:27 
GeneralRe: Memory Management with variables Pin
Gary R. Wheeler18-Jan-04 15:32
Gary R. Wheeler18-Jan-04 15:32 
GeneralRe: Memory Management with variables Pin
SiddharthAtw18-Jan-04 17:18
SiddharthAtw18-Jan-04 17:18 
GeneralUsing ProgressBar in another class Pin
shultas18-Jan-04 14:13
shultas18-Jan-04 14:13 
GeneralRe: Using ProgressBar in another class Pin
David Crow19-Jan-04 2:43
David Crow19-Jan-04 2:43 
Questionhow do i hendel a function when a key is press'd Pin
Bondtje18-Jan-04 13:25
Bondtje18-Jan-04 13:25 
AnswerRe: how do i hendel a function when a key is press'd Pin
Michael Dunn18-Jan-04 16:28
sitebuilderMichael Dunn18-Jan-04 16:28 
Generalfile x-fer help required Pin
Anonymous18-Jan-04 12:17
Anonymous18-Jan-04 12:17 
okay apart from im a newb, im trying to send a file between my client and server in vc++,it works fine with text files and also it works fine localy,when i x-fer a .exe over a network the x-fer fails,i know this is coz winsock's send function cant handle the size of the file im tryin to send,my problem is i need to read a file into a buffer,then make a loop and send parts of the buffer in chunks untill the whole file has been sent this wouldnt be to hard but i dont know how to erase the data alreadie sent from the buffer and then carry on from where it left of,i have tried and failed at doing this and im lookin for some extra help.


const char * filename = downloadbuf.c_str();
char buffer[40500] = "";
long size = 0;
std::ifstream file (filename, std::ios::in | std::ios::binary | std::ios::ate);
if (!file)
{
MessageBox(NULL,"Error Opening File",NULL,MB_OK);
}
size = file.tellg();
file.seekg (0, std::ios::beg);
file.read (buffer, size);
char sizebuf[50];
ltoa(size,sizebuf,10);
send(newsock,sizebuf,strlen(sizebuf),0);
long sent;
//some sort of do while loop here

sent = send(newsock,buffer,size,0);

or rather than having such a big buffer if i read a chunk of the file then sent it then read another chunk of the file!

any ways thanx for ya time,any help wud be much apriciated Wink | ;)
QuestionOk, so when is a variable defined? Pin
Senkwe Chanda18-Jan-04 11:58
Senkwe Chanda18-Jan-04 11:58 
AnswerRe: Ok, so when is a variable defined? Pin
Gary R. Wheeler18-Jan-04 12:13
Gary R. Wheeler18-Jan-04 12:13 
GeneralRe: Ok, so when is a variable defined? Pin
Senkwe Chanda18-Jan-04 13:01
Senkwe Chanda18-Jan-04 13:01 
GeneralRe: Ok, so when is a variable defined? Pin
Gary R. Wheeler18-Jan-04 15:16
Gary R. Wheeler18-Jan-04 15:16 
GeneralRe: Ok, so when is a variable defined? Pin
Senkwe Chanda18-Jan-04 17:12
Senkwe Chanda18-Jan-04 17:12 
AnswerRe: Ok, so when is a variable defined? Pin
Mike Dimmick18-Jan-04 23:34
Mike Dimmick18-Jan-04 23:34 
GeneralRe: Ok, so when is a variable defined? Pin
Senkwe Chanda19-Jan-04 4:42
Senkwe Chanda19-Jan-04 4:42 
GeneralA Discrete Mathematic problem. Pin
MaJr18-Jan-04 11:36
MaJr18-Jan-04 11:36 
GeneralRe: A Discrete Mathematic problem. Pin
Alexander M.,19-Jan-04 2:14
Alexander M.,19-Jan-04 2:14 
GeneralPopup menu pops up in wrong place Pin
Daniel132418-Jan-04 11:18
Daniel132418-Jan-04 11:18 
GeneralRe: Popup menu pops up in wrong place Pin
PJ Arends18-Jan-04 16:31
professionalPJ Arends18-Jan-04 16:31 
GeneralRe: Popup menu pops up in wrong place Pin
Michael Dunn18-Jan-04 16:31
sitebuilderMichael Dunn18-Jan-04 16:31 
GeneralRe: Popup menu pops up in wrong place Pin
Roger Allen18-Jan-04 23:51
Roger Allen18-Jan-04 23:51 
GeneralRe: Popup menu pops up in wrong place Pin
Daniel132419-Jan-04 0:51
Daniel132419-Jan-04 0:51 
GeneralRe: Popup menu pops up in wrong place Pin
фил21-Jan-04 4:50
фил21-Jan-04 4:50 
GeneralSetWaitableTimer Pin
Mikey_E18-Jan-04 10:23
professionalMikey_E18-Jan-04 10:23 
GeneralRe: SetWaitableTimer Pin
Mike Dimmick18-Jan-04 23:39
Mike Dimmick18-Jan-04 23:39 

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.