Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2006 Mar : Newbie in Internet Programming

www.cryer.info
Managed Newsgroup Archive

Newbie in Internet Programming

Subject:Newbie in Internet Programming
Posted by:"Girish" (giri..@discussions.microsoft.com)
Date:Wed, 8 Mar 2006 02:34:19

Hello Friends,

                     I am very new to this forums , I am trying to connect
to a proxy using this code but i am getting error when i am using the
function HttpOpenRequest() i am getting the Error Code 122. Can anybody solve
my problem Following is the Code

                    AfxParseURL(m_URL,dwAccessType,m_Server,m_sObject,m_port);
    

m_hInternetSession=InternetOpen(AfxGetAppName(),dwAccessType,m_Server,NULL,INTERNET_OPEN_TYPE_PROXY);
    if(::InternetSetStatusCallback(m_hInternetSession,_OnStatusCallBack)==INTERNET_INVALID_STATUS_CALLBACK)
    {
            AfxMessageBox("Invalid Status Callback");
    }
    m_hHttpConnection=InternetConnect(m_hInternetSession,m_Server,m_port,NULL,
                        NULL,INTERNET_SERVICE_HTTP,0,(DWORD)this);
    retErr=GetLastError();
    
    if (dwAccessType == AFX_INET_SERVICE_HTTPS)
        dwFlags    |= (INTERNET_FLAG_SECURE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID |
                            INTERNET_FLAG_IGNORE_CERT_DATE_INVALID);


    m_hHttpFile = ::HttpOpenRequest(m_hHttpConnection, NULL,

(m_sObject.GetBuffer(m_sObject.GetLength())),

_T("HTTP/1.1"), NULL, ppszAcceptTypes,

            dwFlags,(DWORD)this);
    retErr=GetLastError();


Thanks in Advance
Girish

Replies:

www.cryer.info
Managed Newsgroup Archive