繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Web Service开发 >> webservice系列教学(10)-如何调用webservice(vc1)

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

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:18  文字大小:【】【】【
简介:4.10使用vc调用 需下载msSoapToolkit20.exe     引用 #import "msxml3.dll" using namespace MSXML2; #import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap1.dl...

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 // MFC core and standard components

#include // MFC extensions

#include // MFC Automation classes

#include // MFC support for Internet Explorer 4 Common Controls

#ifndef _AFX_NO_AFXCMN_SUPPORT

#include // 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 : 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_)

责任编辑:admin
相关文章