Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Retriving Device information attached with system Pin
Hamid_RT20-Jun-07 9:13
Hamid_RT20-Jun-07 9:13 
QuestionProblem removing object from list Pin
Kevin Brydon20-Jun-07 0:28
Kevin Brydon20-Jun-07 0:28 
AnswerRe: Problem removing object from list Pin
Cedric Moonen20-Jun-07 0:49
Cedric Moonen20-Jun-07 0:49 
GeneralRe: Problem removing object from list Pin
Kevin Brydon20-Jun-07 1:20
Kevin Brydon20-Jun-07 1:20 
Questioncyclic reduction on c Pin
ovoundaga19-Jun-07 23:32
ovoundaga19-Jun-07 23:32 
Questioncyclic reduction on c Pin
ovoundaga19-Jun-07 23:28
ovoundaga19-Jun-07 23:28 
AnswerRe: cyclic reduction on c Pin
toxcct20-Jun-07 1:35
toxcct20-Jun-07 1:35 
QuestionHow to download the file using HTTP while the file is being uploaded using FTP? Pin
Jyo200719-Jun-07 21:28
Jyo200719-Jun-07 21:28 
Hi All,

Pls let me know if there is any solution for this problem.

Im starting FTP uploading and at the same time HTTP downloading too for the same server which supports both ftp and http.

File is partially downloading at the receiver.Downloaded file size is less than the actual uploaded file.

Here problem is internetreadfile() is failing to read, once it does not receive data while file is uploading.


m_hHttpFile = HttpOpenRequest(m_hHttpConnection, "GET", FileToDownload, NULL, NULL, ppszAcceptTypes, INTERNET_FLAG_RELOAD |
INTERNET_FLAG_KEEP_CONNECTION, NULL);
if (m_hHttpFile == NULL)
{
return 0;
}

BOOL bSend = ::HttpSendRequest(m_hHttpFile, NULL, 0, NULL, 0);
if (!bSend)
{
AfxMessageBox(" Http download HttpSendRequest failed");

return 0;
}


TCHAR szStatusCode[32];

if (!HttpQueryInfo(m_hHttpFile, HTTP_QUERY_STATUS_CODE, szStatusCode, &dwInfoSize, NULL))
{
AfxMessageBox(" Http download HttpQueryInfo failed");

CString strMsg;
strMsg.Format("Error:%d", GetLastError());
//AfxMessageBox(strMsg);

return 0;
}

long nStatusCode = _ttol(szStatusCode);
if (nStatusCode != HTTP_STATUS_OK)
{
AfxMessageBox(" Http download server file not available ");
return 0;
}

DWORD dwBytesRead = 0;
char szReadBuf[TRANSFER_SIZE+1];
CFileException e;

m_FileToWrite.Open(LocalFile, CFile::modeCreate | CFile::modeWrite /*| CFile::shareDenyWrite*/);

double sum = 0;
do
{
if (!::InternetReadFile(m_hHttpFile, szReadBuf, TRANSFER_SIZE, &dwBytesRead))
{
AfxMessageBox("Http download InternetReadFile Failed");
return 0;
}

if(dwBytesRead>0)
{
TRY
{
m_FileToWrite.Write(szReadBuf, dwBytesRead);
}
CATCH(CFileException, e);
{
e->Delete();
return 0;
}
END_CATCH
}

sum += dwBytesRead;
}
while(sum!=filelength);
AnswerRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
Iain Clarke, Warrior Programmer19-Jun-07 23:46
Iain Clarke, Warrior Programmer19-Jun-07 23:46 
GeneralRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
Jyo200720-Jun-07 0:53
Jyo200720-Jun-07 0:53 
QuestionRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
David Crow20-Jun-07 2:39
David Crow20-Jun-07 2:39 
AnswerRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
programmer8120-Jun-07 3:10
programmer8120-Jun-07 3:10 
GeneralRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
David Crow20-Jun-07 4:51
David Crow20-Jun-07 4:51 
AnswerRe: How to download the file using HTTP while the file is being uploaded using FTP? Pin
Hamid_RT20-Jun-07 9:10
Hamid_RT20-Jun-07 9:10 
QuestionProblem in opening the windows registery Pin
Neeraj Sinha19-Jun-07 21:24
Neeraj Sinha19-Jun-07 21:24 
AnswerRe: Problem in opening the windows registery Pin
Cedric Moonen19-Jun-07 21:34
Cedric Moonen19-Jun-07 21:34 
GeneralRe: Problem in opening the windows registery Pin
Neeraj Sinha19-Jun-07 21:48
Neeraj Sinha19-Jun-07 21:48 
AnswerRe: Problem in opening the windows registery Pin
Jonathan [Darka]19-Jun-07 21:41
professionalJonathan [Darka]19-Jun-07 21:41 
AnswerRe: Problem in opening the windows registery Pin
Jhony george19-Jun-07 21:47
Jhony george19-Jun-07 21:47 
GeneralRe: Problem in opening the windows registery Pin
Neeraj Sinha19-Jun-07 22:16
Neeraj Sinha19-Jun-07 22:16 
AnswerRe: Problem in opening the windows registery Pin
Hamid_RT20-Jun-07 9:06
Hamid_RT20-Jun-07 9:06 
QuestionControl problem Pin
hanlei000000000919-Jun-07 21:07
hanlei000000000919-Jun-07 21:07 
AnswerRe: Control problem Pin
Jonathan [Darka]19-Jun-07 21:42
professionalJonathan [Darka]19-Jun-07 21:42 
AnswerRe: Control problem Pin
toxcct20-Jun-07 1:37
toxcct20-Jun-07 1:37 
QuestionHow to calculate vertical scroll bar's width Pin
Peter, Chan19-Jun-07 21:06
Peter, Chan19-Jun-07 21:06 

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.