webservice系列教學(10)-如何調用webservice(vc1)

來源:互聯網
上載者:User
web 4.10使用vc調用
需下載msSoapToolkit20.exe
    引用
#import "msxml3.dll"
using namespace MSXML2;
#import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap1.dll" exclude("IStream", "ISequentialStream", "_LARGE_INTEGER", "_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME") raw_interfaces_only
using namespace MSSOAPLib;
常式:
建立工程àMFC AppWizard(exe)[ Mclient]àstep1à基本對話à其他預設值即可
修改源檔案:
< StdAfx.h>
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__045CD307_9518_4AF1_8CE3_8FFE38D1ACB2__INCLUDED_)
#define AFX_STDAFX_H__045CD307_9518_4AF1_8CE3_8FFE38D1ACB2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>       // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>         // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT



#import "msxml3.dll"
using namespace MSXML2;

#import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap1.dll" exclude("IStream", "ISequentialStream", "_LARGE_INTEGER", "_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME") raw_interfaces_only
using namespace MSSOAPLib;


#define MSG(message) \
{ \
    ::MessageBox(NULL,_T(message),NULL,MB_OK | MB_ICONEXCLAMATION| MB_APPLMODAL);\
    goto cleanup; \
}


#define CHECK_HRESULT(hr, message) \
if (FAILED(hr)) \
{ \
    MSG(message); \
}


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__045CD307_9518_4AF1_8CE3_8FFE38D1ACB2__INCLUDED_)
<MClient.h>
// MClient.h : main header file for the MCLIENT application
//

#if !defined(AFX_MCLIENT_H__9A397DA6_5A62_4AEF_BE5E_6C7629322ECC__INCLUDED_)
#define AFX_MCLIENT_H__9A397DA6_5A62_4AEF_BE5E_6C7629322ECC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
    #error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CMClientApp:
// See MClient.cpp for the implementation of this class
//

class CMClientApp : public CWinApp
{
public:
    CMClientApp();

// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CMClientApp)
    public:
    virtual BOOL InitInstance();
    //}}AFX_VIRTUAL

// Implementation

    //{{AFX_MSG(CMClientApp)
        // NOTE - the ClassWizard will add and remove member functions here.
        //    DO NOT EDIT what you see in these blocks of generated code !
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MCLIENT_H__9A397DA6_5A62_4AEF_BE5E_6C7629322ECC__INCLUDED_)
 

相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

11.11 Big Sale for Cloud

Get Unbeatable Offers with up to 90% Off,Oct.24-Nov.13 (UTC+8)

Get It Now >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。