Solved

Using CInternetSession with a proxy server

Posted on 1997-05-26
1
831 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

707 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now