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

📄 close.c

📁 分布式传输功能
💻 C
字号:
/*file:helloc1.c*/

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "hello.h"
#include "helloc.h"
#include <assert.h>

void main()
{
	
	RPC_STATUS status;
	unsigned char *pszUuid=NULL;
	unsigned char *pszProtocolSequence ="ncacn_np";
	unsigned char *pszNetworkAddress =NULL;
	unsigned char *pszEndpoint ="\\pipe\\hello0";
	unsigned char *pszOptions =NULL;
	unsigned char *pszStringBinding =NULL;
	unsigned char *pszString ="hello,RPC_Server!";
	short i=20;
	unsigned long ulCode;
	float num=10;
	//float balance=100; 
	// int result=2;
	

	status =RpcStringBindingCompose(pszUuid,
	                             	pszProtocolSequence,
		                            pszNetworkAddress,
									 pszEndpoint,
									 pszOptions,
									 &pszStringBinding);
	printf("%s",pszStringBinding);

	status = RpcBindingFromStringBinding(pszStringBinding,
                                         &hello_IfHandle);
	printf("RpcBindingFromStringBinding returned: 0x%x\n", status);
	 if(status)
	{
		exit(status);
	}
 
   
	 
	RpcTryExcept
	{
    	 printf("请按任意建结束");
    	getch();
    	Shutdown();

	}
	RpcExcept(1)
	{
		ulCode =RpcExceptionCode();
		printf("Runtime reported exception 0x%lx =%ld \n",ulCode,ulCode);
	//	getch();
	}
	RpcEndExcept

    

	status=RpcStringFree(&pszStringBinding);
	if(status)
	{
		exit(status);
	}
	status=RpcBindingFree(&hello_IfHandle);
	if(status)
	{
		exit(status);
	}
	exit(0);
}//end main()
//void __RPC_FAR * __RPC_API midl_user_allocate(size_t len)

void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
{
	return(malloc(len));
}
//void __RPC_API midl_user_free(void __RPC_FAR  *ptr)
void __RPC_USER midl_user_free( void __RPC_FAR *ptr)
{
	free(ptr);
}

⌨️ 快捷键说明

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