正 文

Web服务系列教学-如何调用WebService(4)


www.7dspace.com  更新日期:2005-9-17 2:22:03  七度空间


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); \
}

6页,当前在第1页  1  2  3  4  5  6  

上一篇:10大windows桌面应用技巧
下一篇:Web服务系列教学-如何调用WebService(5)
作者:  来源:5ivb ( 责任编辑:7dspace )
收藏此页】【打印】【关闭
站 内 搜 索
 

热 点 导 读
特 别 推 荐