Click here to Skip to main content
15,914,905 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Questionexports enum from COM Pin
vijay.victory20-Jan-09 22:13
vijay.victory20-Jan-09 22:13 
AnswerRe: exports enum from COM Pin
Jonathan Davies21-Jan-09 0:05
Jonathan Davies21-Jan-09 0:05 
GeneralRe: exports enum from COM Pin
Jonathan Davies21-Jan-09 0:28
Jonathan Davies21-Jan-09 0:28 
GeneralRe: exports enum from COM Pin
vijay.victory21-Jan-09 2:26
vijay.victory21-Jan-09 2:26 
AnswerRe: exports enum from COM Pin
Stuart Dootson21-Jan-09 0:07
professionalStuart Dootson21-Jan-09 0:07 
QuestionCAtlHttpClient Pin
TURK18-Jan-09 7:08
TURK18-Jan-09 7:08 
AnswerRe: CAtlHttpClient Pin
Stuart Dootson18-Jan-09 7:37
professionalStuart Dootson18-Jan-09 7:37 
GeneralRe: CAtlHttpClient Pin
TURK18-Jan-09 8:16
TURK18-Jan-09 8:16 
// copy from MSDN HTTPClient atl example project

class CSampleBasicAuth : public CBasicAuthObject, public IAuthInfo
{

    void Init(CAtlHttpClient *pSocket, IAuthInfo *pAuthInfo)
    {
        CBasicAuthObject::Init( pSocket, pAuthInfo );
    }
    

    bool Authenticate(LPCTSTR szAuthTypes, bool bProxy)
    {
        /*
        CBasicAuthDlg authDlg;
    
        if (authDlg.DoModal() == IDOK)
        {
            username = authDlg.m_username; 
            password = authDlg.m_password;

            return CBasicAuthObject::Authenticate( szAuthTypes, bProxy );
        }
        */
        username = _T("user");
        password = _T("password");

        return CBasicAuthObject::Authenticate( szAuthTypes, bProxy );
    }

    HRESULT GetPassword(LPTSTR szPwd, DWORD* dwBuffSize)
    {
        if (CopyCString( password, szPwd, dwBuffSize ))
            return S_OK;

        return E_FAIL;
    }

    HRESULT GetUsername(LPTSTR szUid, DWORD* dwBuffSize)
    {
        if (CopyCString( username, szUid, dwBuffSize ))
            return S_OK;

        return E_FAIL;
    }
    HRESULT GetDomain(LPTSTR szDomain, DWORD* dwBuffSize)
    {
        ATLASSERT(false);
        return S_OK;
    }

    CString username;
    CString password;
};



// Create a pointer to my service
Service::CService *srv = new Service::CService();
 
CAtlHttpClient &httpClient = srv->m_socket;

CSampleBasicAuth *basicAuth = new CSampleBasicAuth();	
	
httpClient.NegotiateAuth(true);
httpClient.AddAuthObj( ATL_HTTP_AUTHTYPE_BASIC, basicAuth, basicAuth );


srv.doSomeThing()..




what's wrong ?

thanks
GeneralRe: CAtlHttpClient Pin
Stuart Dootson18-Jan-09 8:27
professionalStuart Dootson18-Jan-09 8:27 
GeneralRe: CAtlHttpClient Pin
TURK18-Jan-09 9:51
TURK18-Jan-09 9:51 
QuestionCListViewCtrl creation does not produce column header arrow indicating sort order Pin
Jonathan Davies18-Jan-09 4:04
Jonathan Davies18-Jan-09 4:04 
AnswerRe: CListViewCtrl creation does not produce column header arrow indicating sort order Pin
Stuart Dootson18-Jan-09 5:38
professionalStuart Dootson18-Jan-09 5:38 
GeneralRe: CListViewCtrl creation does not produce column header arrow indicating sort order Pin
Jonathan Davies18-Jan-09 11:34
Jonathan Davies18-Jan-09 11:34 
QuestionHow to achieve receiving file name using ICopyHook interface? Pin
SNI14-Jan-09 23:00
SNI14-Jan-09 23:00 
AnswerRe: How to achieve receiving file name using ICopyHook interface? Pin
Stuart Dootson17-Jan-09 23:01
professionalStuart Dootson17-Jan-09 23:01 
AnswerRe: How to achieve receiving file name using ICopyHook interface? Pin
gopu7418-Nov-09 5:53
gopu7418-Nov-09 5:53 
GeneralATL COM and DLL comparision........... [modified] Pin
vijay.victory13-Jan-09 23:52
vijay.victory13-Jan-09 23:52 
GeneralRe: ATL COM and DLL comparision........... Pin
Stuart Dootson14-Jan-09 10:37
professionalStuart Dootson14-Jan-09 10:37 
QuestionBSTR=> CHARACTER ARRAY => BSTR conversion Pin
CHAN_SAI13-Jan-09 22:54
CHAN_SAI13-Jan-09 22:54 
AnswerRe: BSTR=> CHARACTER ARRAY => BSTR conversion Pin
Stuart Dootson13-Jan-09 23:54
professionalStuart Dootson13-Jan-09 23:54 
GeneralRe: BSTR=> CHARACTER ARRAY => BSTR conversion Pin
CHAN_SAI14-Jan-09 14:37
CHAN_SAI14-Jan-09 14:37 
GeneralRe: BSTR=> CHARACTER ARRAY => BSTR conversion Pin
Stuart Dootson14-Jan-09 20:56
professionalStuart Dootson14-Jan-09 20:56 
QuestionATL_MSG_MAP identifier not found Pin
josip cagalj13-Jan-09 0:57
josip cagalj13-Jan-09 0:57 
AnswerRe: ATL_MSG_MAP identifier not found Pin
Stuart Dootson13-Jan-09 4:09
professionalStuart Dootson13-Jan-09 4:09 
GeneralRe: ATL_MSG_MAP identifier not found Pin
josip cagalj13-Jan-09 21:18
josip cagalj13-Jan-09 21:18 

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.