Click here to Skip to main content
15,908,834 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to display an image loaded from a file on a dialog ? Pin
algol13-Jan-04 21:34
algol13-Jan-04 21:34 
GeneralSetTopIndex functionality in Combolist (Droplist) Pin
bluebar12-Jan-04 22:06
bluebar12-Jan-04 22:06 
Generalsystem tray popup menu problem Pin
skpanda12-Jan-04 21:46
skpanda12-Jan-04 21:46 
GeneralRe: system tray popup menu problem Pin
Roger Allen13-Jan-04 1:03
Roger Allen13-Jan-04 1:03 
GeneralGets file through proxy with autorization Pin
Eugene Pustovoyt12-Jan-04 21:22
Eugene Pustovoyt12-Jan-04 21:22 
GeneralRe: Gets file through proxy with autorization Pin
murali_utr13-Jan-04 0:11
murali_utr13-Jan-04 0:11 
GeneralRe: Gets file through proxy with autorization Pin
Eugene Pustovoyt13-Jan-04 1:11
Eugene Pustovoyt13-Jan-04 1:11 
GeneralRe: Gets file through proxy with autorization Pin
murali_utr13-Jan-04 1:41
murali_utr13-Jan-04 1:41 
Hi,
use this code.

#include <afxinet.h>
//assumes server, port and URL names have been initialized
CInternetSession session("My Session");
CHttpConnection* pServer = NULL;
CHttpFile* pFile = NULL;
try
{
CString strServerName;
INTERNET_PORT nPort;

INTERNET_PROXY_INFO proxyinfo;
proxyinfo.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
proxyinfo.lpszProxy = CStrProxy;
proxyinfo.lpszProxyBypass = NULL;
session.SetOption(INTERNET_OPTION_PROXY, (LPVOID)&proxyinfo, sizeof(INTERNET_PROXY_INFO));

pServer = session.GetHttpConnection(strServerName, nPort);
pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject);
pFile->AddRequestHeaders(szHeaders);
pFile->SendRequest();
pFile->QueryInfoStatusCode(dwRet);

if (dwRet == HTTP_STATUS_OK)
{
UINT nRead = pFile->Read(szBuff, 1023);
while (nRead > 0)
{
//read file...
}
}
delete pFile;
delete pServer;
}
catch (CInternetException* pEx)
{
//catch errors from WinInet
}
session.Close();


Have A Nice Day
Murali.M
GeneralRe: Gets file through proxy with autorization Pin
Eugene Pustovoyt13-Jan-04 2:27
Eugene Pustovoyt13-Jan-04 2:27 
GeneralRe: Gets file through proxy with autorization Pin
murali_utr13-Jan-04 17:41
murali_utr13-Jan-04 17:41 
GeneralRe: Gets file through proxy with autorization Pin
Eugene Pustovoyt13-Jan-04 18:10
Eugene Pustovoyt13-Jan-04 18:10 
GeneralDownload Management Pin
abhinarulkar12-Jan-04 21:22
abhinarulkar12-Jan-04 21:22 
GeneralRe: Download Management Pin
Mike Dimmick13-Jan-04 2:13
Mike Dimmick13-Jan-04 2:13 
GeneralRe: Download Management Pin
abhinarulkar14-Jan-04 3:40
abhinarulkar14-Jan-04 3:40 
GeneralImporting JPEG in MFC Pin
hurr1can312-Jan-04 21:04
hurr1can312-Jan-04 21:04 
GeneralRe: Importing JPEG in MFC Pin
l a u r e n12-Jan-04 21:17
l a u r e n12-Jan-04 21:17 
GeneralRe: Importing JPEG in MFC Pin
Selvam R12-Jan-04 22:02
professionalSelvam R12-Jan-04 22:02 
GeneralRe: Importing JPEG in MFC Pin
Prakash Nadar13-Jan-04 0:18
Prakash Nadar13-Jan-04 0:18 
QuestionIs there such a API function for thread? Pin
zhaopzhi12-Jan-04 20:33
zhaopzhi12-Jan-04 20:33 
GeneralOdd CEdit Pin
AntonGogolev12-Jan-04 20:30
AntonGogolev12-Jan-04 20:30 
GeneralRe: Odd CEdit Pin
Paul Hooper12-Jan-04 21:34
Paul Hooper12-Jan-04 21:34 
GeneralModify Registry Data Pin
SiddharthAtw12-Jan-04 20:06
SiddharthAtw12-Jan-04 20:06 
Generalreferer url. Pin
murali_utr12-Jan-04 19:37
murali_utr12-Jan-04 19:37 
GeneralI Got it Pin
murali_utr12-Jan-04 20:12
murali_utr12-Jan-04 20:12 
GeneralWh_Getmessage hook Pin
percyvimal12-Jan-04 19:26
percyvimal12-Jan-04 19:26 

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.