类型转换

来源:互联网 发布:尼尔机械纪元卡顿优化 编辑:程序博客网 时间:2024/04/30 05:35

1、char * 转换成 LPCTSTR


      char s[10];

      WCHAR Ws[10];

      memset(s,0,10 * sizeof(char));

      memset(Ws,0,10 * sizeof(WCHAR));

      sprintf(s,"%s","Mychar..");

      MultiByteToWideChar(CP_ACP, 0, s, strlen(s) + 1, Ws, sizeof(Ws) / sizeof(Ws[0]));

0 0
原创粉丝点击