实验一 远程过程调用中间件及数据访问中间件
https://blog.csdn.net/u011402642/article/details/46317827?utm_source=blogxgwz9
https://1024tools.com/uuid
错误处理
-
将编译好的文件放到:C:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\AddIns
https://www.cr173.com/html/13439_1.html -
将
C:\Program Files (x86)\Microsoft Visual Studio\VC98\BinandC:\Program Files (x86)\Microsoft Visual Studio\Common\MSDev98\Bin加入到环境变量中 -
vc6.0 没有找到mspdb60.dll 的解决方法
https://blog.csdn.net/developinglife/article/details/6393400
mathservice.idl
[
uuid("ff07ca57-6f46-40ab-91c6-3257c199daf7"), // genurate by GUIDGen.exe
version(1.0)
]
interface Compute
{
void Shutdown(void);
float add(float a, float b);
float substract(float a, float b);
float logg(float a);
}
mathservic.acf
[
implicit_handle(handle_t Compute_Binding)
]
interface Compute
{
}
server.c
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void Shutdown(void)
{
RpcMgmtStopServerListening(NULL);
RpcServerUnregisterIf(NULL, NULL, FALSE);
}
float substract(float a, float b)
{
return a-b;
}
float logg(float a)
{
return log(a);
}
float add(float a, float b)
{
return a+b;
}
int main(int argc,char * argv[])
{
RpcServerUseProtseqEp((unsigned char *)"ncacn_np", 20, (unsigned char *)"\\pipe\\{8dd50205-3108-498f-96e8-dbc4ec074cf9}", NULL);
RpcServerRegisterIf(Compute_v1_0_s_ifspec, NULL, NULL);
RpcServerListen(1,20,FALSE);
return 0;
}
void __RPC_FAR* __RPC_USER midl_user_allocate(size_t len)
{
return(malloc(len));
}
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
{
free(ptr);
}
运行命令
cl /D_WINNE=0x500 server.c MathServer_s.c
代码改变世界

浙公网安备 33010602011771号