首页 > 开发 > 综合 > 正文

webservice系列教学(10)-如何调用webservice(vc1)

2024-07-21 02:21:46
字体:
来源:转载
供稿:网友

最大的网站源码资源下载站,

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_)
 
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表