⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mqclient.cpp

📁 Visual C++.net编成指南一书的源代码
💻 CPP
字号:
// File: MQClient.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 "SoapMQClient.h"

void main(char argc, char** argv)
{

	if( argc != 2 )
	{
		printf("Usage : MQClient <machine_name>\n"
			"\t\t<machine_name> : the name of the machine where the message is/should be created\n");
		return;
	}

	CoInitialize(NULL);

	{
		BSTR bstrIn, bstrOut;
		
		// Instantiate the template on the debug client instead of one of the  ...Inet clients
		CSimpleSoapAppServiceT<CSoapMQClient>	srv;
		CStringA			strReqQueue, strResponseQueue;
		strReqQueue.Format("%s\\SOAPRequests", argv[1]);
		strResponseQueue.Format("%s\\SOAPResponses", argv[1]);

		
		srv.SetQueues( strReqQueue, strResponseQueue);
		// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -