Click here to Skip to main content
15,867,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: wcstok Pin
csrss13-Jan-11 4:28
csrss13-Jan-11 4:28 
QuestionRegistry Reading problem in Windows 7 Pin
Debojyoti Majumder13-Jan-11 0:30
Debojyoti Majumder13-Jan-11 0:30 
AnswerRe: Registry Reading problem in Windows 7 Pin
Madhu Nair13-Jan-11 1:05
Madhu Nair13-Jan-11 1:05 
QuestionThread Context Switch : Thread which do nothing takes more time to switch Pin
pandit8412-Jan-11 23:12
pandit8412-Jan-11 23:12 
AnswerRe: Thread Context Switch : Thread which do nothing takes more time to switch Pin
User 742933813-Jan-11 0:20
professionalUser 742933813-Jan-11 0:20 
AnswerRe: Thread Context Switch : Thread which do nothing takes more time to switch Pin
Luc Pattyn13-Jan-11 1:52
sitebuilderLuc Pattyn13-Jan-11 1:52 
AnswerRe: Thread Context Switch : Thread which do nothing takes more time to switch Pin
rod naR18-Jan-11 17:27
rod naR18-Jan-11 17:27 
QuestionDownload file using CInternetSession [modified] Pin
john563212-Jan-11 21:37
john563212-Jan-11 21:37 
Hi,

I am trying to download a zip file from server using CInternetSession. But i am getting incorrect size from server.
My application is unicode and code as below:
 pConnection = session.GetHttpConnection((LPCTSTR)strServerName, (INTERNET_PORT)nPort);//, (LPCTSTR)NULL, (LPCTSTR)NULL);
 LPCTSTR pstrAcceptTypes = NULL;
    LPCTSTR pstrVersion = NULL;

// Open and send the request
        pHttpFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject, NULL, 1, &pstrAcceptTypes, pstrVersion, HttpRequestFlags);

              pHttpFile->AddRequestHeaders(szHeaders);
        pHttpFile->AddRequestHeaders(_T("User-Agent: GetWebFile/1.0\r\n"), HTTP_ADDREQ_FLAG_ADD_IF_NEW);
        pHttpFile->SendRequest();

        pHttpFile->QueryInfoStatusCode(dwRet);//getting 200

        int nFileLen = pFile->GetLength(); //getting 7


why I am getting incorrect size? Anything wrong in this code?

Same code was working with ANSI build and not working with unicode build.

modified on Thursday, January 13, 2011 5:43 AM

AnswerRe: Download file using CInternetSession Pin
KingsGambit12-Jan-11 22:07
KingsGambit12-Jan-11 22:07 
AnswerRe: Download file using CInternetSession Pin
Richard MacCutchan12-Jan-11 22:18
mveRichard MacCutchan12-Jan-11 22:18 
GeneralRe: Download file using CInternetSession Pin
john563212-Jan-11 22:39
john563212-Jan-11 22:39 
GeneralRe: Download file using CInternetSession Pin
Richard MacCutchan12-Jan-11 23:49
mveRichard MacCutchan12-Jan-11 23:49 
GeneralRe: Download file using CInternetSession Pin
john563213-Jan-11 0:05
john563213-Jan-11 0:05 
GeneralRe: Download file using CInternetSession Pin
Richard MacCutchan13-Jan-11 0:57
mveRichard MacCutchan13-Jan-11 0:57 
AnswerRe: Download file using CInternetSession Pin
Cool_Dev12-Jan-11 23:49
Cool_Dev12-Jan-11 23:49 
Questionhow to create dynamically popupmenu? Pin
yogish29312-Jan-11 21:11
yogish29312-Jan-11 21:11 
QuestionRe: how to create dynamically popupmenu? Pin
CPallini12-Jan-11 21:28
mveCPallini12-Jan-11 21:28 
AnswerRe: how to create dynamically popupmenu? Pin
Cedric Moonen12-Jan-11 21:35
Cedric Moonen12-Jan-11 21:35 
AnswerRe: how to create dynamically popupmenu? Repost of a repost Pin
Richard MacCutchan12-Jan-11 22:15
mveRichard MacCutchan12-Jan-11 22:15 
AnswerRe: how to create dynamically popupmenu? Pin
jk chan12-Jan-11 22:22
jk chan12-Jan-11 22:22 
AnswerRe: how to create dynamically popupmenu? Pin
Hamid_RT12-Jan-11 22:37
Hamid_RT12-Jan-11 22:37 
GeneralRe: how to create dynamically popupmenu? Pin
yogish29313-Jan-11 0:54
yogish29313-Jan-11 0:54 
AnswerRe: how to create dynamically popupmenu? Pin
JohnCz14-Jan-11 12:33
JohnCz14-Jan-11 12:33 
QuestionRe:MessageBox not showing Pin
Debojyoti Majumder12-Jan-11 19:44
Debojyoti Majumder12-Jan-11 19:44 
AnswerRe:MessageBox not showing Pin
Andrew Brock12-Jan-11 20:00
Andrew Brock12-Jan-11 20:00 

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.