[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. extern "C" _declspec(dllexport)void h2p(const char* szChinese)
  2. {
  3.     uint32_t bufLen = 0;
  4.     char pinyinBuf[MAXBUFLEN] = { 0 };
  5.     //const char* szChinese = "中华人民共和国 People's Republic of China";
  6.     getPinyin(szChinese, pinyinBuf, MAXBUFLEN, &bufLen, enmPinyinMode_FirstUpper);
  7.     printf("%s\n", pinyinBuf);
  8. }
复制代码
  1. $code=@"
  2. using System;
  3. using System.Runtime.InteropServices;
  4. public static class Api{
  5. [DllImport("C:/Users/Administrator/source/repos/test/x64/Release/test.dll")]
  6. public static extern int h2p(String ss);
  7.     }
  8. "@
  9. Add-Type -TypeDefinition $code
  10. [Api]::h2p("我是中国人")
复制代码

TOP

回复 14# 小白龙


    我用的vs2019。小白一个,对原理,报错啥的我都不怎么会,只是点一下按钮生成一下。
我用的dll
https://t.wss.ink/f/aq9mrsmo32b 复制链接到浏览器打开

TOP

回复 33# 小白龙


    64位的,我这边正常。其他的不清楚

TOP

返回列表