floppyclient.cpp

来自「Visual C++.net编成指南一书的源代码」· C++ 代码 · 共 49 行

CPP
49
字号
// File: FloppyClient.cpp
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Classes Reference and related electronic
// documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft C++ Libraries products.

// include the file generated by sproxy for simpleTestApp.dll
#include "stdafx.h"

#include "SimpleSoapAppProxy.h"
using namespace SimpleSoapAppService;

// Include the header for the Debug client
#include "SoapFloppyClient.h"

void main()
{
	
	CoInitialize(NULL);

	{
		BSTR bstrIn, bstrOut;
		
		// Instantiate the template on the debug client instead of one of the  ...Inet clients
		// Using the URL from the WSDL, which already contains Handler=Default
		CSimpleSoapAppServiceT<CSoapFloppyClient>	srv;

		// If a different service is targetted, a call to the following should be inserted here
		// srv.SetUrl("http://...?Handler=OtherServiceName"

		// Everything after this line is NOT specific to the SoapDebugClient
		bstrIn	=	::SysAllocString(L"User");
		
		HRESULT hr = srv.HelloWorld(bstrIn, &bstrOut);
	
		printf("Return : %d\n", hr);
		if( SUCCEEDED(hr))
		{
			printf("Result %S\n", bstrOut);
			::SysFreeString( bstrOut);
		}
		
		srv.Cleanup();
	}
	CoUninitialize();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?