错误C2664:无法将参数1从'unsigned char *'转换为'RPC_WSTR'

时间:2013-04-10 08:42:35

标签: c++ visual-studio compiler-errors client-server rpc

我正在尝试创建一个RPC服务器和客户端程序。 我正在使用本教程http://www.codeproject.com/Articles/4878/Introduction-to-RPC-Part-2

我完全按照网站中的原样复制了代码,但是当我尝试运行它时出现此错误:

  

错误1错误C2664:'RpcServerUseProtseqEpW':无法将参数1从'char *'转换为'RPC_WSTR'

问题在于:

  status = RpcServerUseProtseqEp(
  reinterpret_cast<unsigned char*>("ncacn_ip_tcp"), // Use TCP/IP protocol.
  RPC_C_PROTSEQ_MAX_REQS_DEFAULT, // Backlog queue length for TCP/IP.
  reinterpret_cast<unsigned char*>("4747"), // TCP/IP port to use.
  NULL); // No security.

0 个答案:

没有答案