Try this:
[DllImport("DJTTS.dll",CharSet=CharSet.Auto)]
public static extern short DJTTS_StartPlayText(short wChnlNo,StringBuilder pText,short size,short IsFemale);
[DllImport("DJTTS.dll",CharSet=CharSet.Auto)]
public static extern short DJTTS_StartPlayText(short wChnlNo,StringBuilder pText,short size,short IsFemale);
解决方案 »
- ASPX网页上面的按钮文字换行,使用了 word-wrap: break-word;在ie上市可以换行的,但是加载到webbrowser上就不能换行,求解啊
- 我做了C#的登录界面,新手送分题
- C#如何同时使用两个摄像头?
- winform中组合控件如何设置RadioButton的组
- winform下app.config文件编译问题
- 关于combobox只读?
- c#比vc.net怎么样?
- 关于C#中GetHashCode()算法移植到node.js中的问题
- 如何用 C# 做 使用者输入 mail 格时的验证
- c#怎样关闭浏览器窗口?
- C#程序可以在WIN98下使用吗?
- listView_click事件不响应,( 简直就是甩卖)
public static extern short DJTTS_StartPlayText(short wChnlNo,[in,out] char pText,short size,short IsFemale);or[DllImport("DJTTS.dll",CharSet=CharSet.Auto)]
public static extern short DJTTS_StartPlayText(short wChnlNo,[out] char pText,short size,short IsFemale);
BTW,what is wChnlNo?
modifier.Hope it would help you.
wChnlNo是一个通道号short型的,不用考虑它
Tc08aLib.DJTTS_StartPlayText(0,welcome.ToCharArray()[0],(short)welcome.Length,1);
Tc08aLib.DJTTS_StartPlayText(0,welcome.Chars[0],(short)welcome.Length,1);
Tc08aLib.DJTTS_StartPlayText(0,welcome[0],(short)welcome.Length,1);
兄弟们真是倾力相助了你写的两种方法都试过了还是不行?怎么办啊?
public static extern int DJTTS_StartPlayText(short wChnlNo,[MarshalAs(UnmanagedType.LPStr)]string pText, int size, int IsFemale);
DJTTS_StartPlayText(0,welcome,strlen(welcome),1);
public static extern int DJTTS_StartPlayText(short wChnlNo, string pText, int size, int IsFemale);
所以 VC++下 LPTSTR welcome = "语音测试"; 正确
LPSTR welcome = "语音测试"; 也同样正确