autohotkey DllCall截断输入字符串

时间:2019-11-14 12:45:17

标签: .net autohotkey

我正在尝试从Autohotkey调用.NET方法。问题是,如果我传递字符串,则仅传递第一个字符,而我不知道为什么或如何对其进行故障排除。欢迎任何建议。

.NET:
[DllExport("add2", CallingConvention = CallingConvention.Cdecl)]
public static string add2(string x) { return x.Length.ToString(); }
// I use .NET 4.7.2, x64

ahk:
T := DllCall("DotNetForAHK\add2", "Str", "Why???", "Cdecl AStr")
MsgBox, %T%

尽管我传递了“为什么?”,但ahk调用始终返回1。 -它应该返回6。

非常感谢

0 个答案:

没有答案
相关问题