Solved

Using CInternetSession with a proxy server

Posted on 1997-05-26
1
883 Views
Last Modified: 2013-11-19
At my company we have to go through a proxy server that reqiur a username and password. My problem is that I cant go through to the internet with the code at the bottom. If I ftp local and I disable the proxy setting in the registry it work fine. And I made double sure my passwords are correct.Can you please help me or give me some code that make use of the proxy settings.Here are some of my code
DWORD UsernameLen = 20, PassLen = 20;
BOOL temp2;

m_pInetSession = new CInternetSession( NULL, 1, INTERNET_OPEN_TYPE_PROXY,  "firewall.sasol.com:80", NULL, 0 );
m_pInetSession = new CInternetSession( );
if (m_pInetSession->SetOption( INTERNET_OPTION_USERNAME, (LPVOID) Username, UsernameLen ) == FALSE) return;
if (m_pInetSession->SetOption( INTERNET_OPTION_PASSWORD, (LPVOID) Password, PassLen ) == FALSE) return;//QueryOption

m_pFtpConnection = m_pInetSession->GetFtpConnection( "155.237.42.26","utilftp","sasol" );
0
Comment
Question by:401980
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1301823
Are you using a CERN proxy? WININET, the system DLL that actually implements the CFtpConnection object for MFC, turns out to not support FTP connections through CERN proxies.

You _can_ get the connection to work through the proxy, though; you'll have to use the INTERNET_FLAG_RAW_DATA flag in the dwFlags parameter.  The technique you'll need to use is documented in the Microsoft KnowledgeBase.  Please see the article at http://www.microsoft.com/kb/articles/q166/9/61.htm

.B ekiM

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CRON statement to run every 3 minutes except on Monday morning 12am to 2am 7 123
sumDigits challenge 9 180
only14 challenge 19 89
x-bar in Google Sheets 2 130
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question