- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试从 AutoIt 3(最新版本)调用一个名为“通用语音”的 C 样式库。我从正在调用的函数中获得了所需的操作,但在我收到响应后 AutoIt 崩溃并显示“AutoIt 已停止工作,Windows 可以搜索解决方案...”我做错了什么吗?
AutoIt:
#notrayicon
dllcall("UniversalSpeech.dll", "int", "speechSayA", "str", "test 123", "int", 1)
sleep(1000)
通用语音.h:
#ifndef ____UNIVERSAL_SPEECH_H__
#define ____UNIVERSAL_SPEECH_H__
#if defined __WIN32 || defined __WIN64
#define export __declspec(dllexport)
#else
#error Platform currently unsupported
#endif
#ifdef __cplusplus
extern "C" {
#endif
int export speechSayA (const char* str, int interrupt) ;
#ifdef __cplusplus
} // extern "C"
#endif
#endif
我用其他编程语言成功做到了这一点,但 AutoIt 似乎不喜欢它。
最佳答案
AutoIt 论坛上的“binhnx”解决了我的问题:
这个库使用cdecl
调用约定,AutoIt 默认使用stdcall
调用约定。支持 Cdecl,但您必须通过在您正在调用的函数的返回类型旁边输入 :cdecl
来告诉 AutoIt 您想要使用它。
所以在我的例子中而不是:
dllcall("UniversalSpeech.dll", "int"...)
你会这样:
dllcall("UniversalSpeech.dll", "int:cdecl"...)
这解决了崩溃问题。
关于调用 C 风格的 DLL 成功,然后 AutoIt 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27317712/
我可以使用什么函数来暂停 AutoIt 中的脚本? 我知道我可以像这样使用 sleep : Func TogglePause() $Paused = NOT $Paused While
我试图摆脱所有窗口上的最小化、最大化和关闭按钮。谷歌搜索我发现这个: $h = WinGetHandle("[CLASS:Notepad]") $iOldStyle = _WinAPI_GetWind
AutoIt FileCopy method定义以下返回值: Return Value Success: 1. Failure: 0. 显然,当文件复制操作失败时,我想告诉用户失败的原因。我如何获得这
我有两个文本框和一个按钮。如何在文本框中输入一个值,然后使用 AutoIt 按 Enter 按钮? 最佳答案 举个例子就这么简单: $gui = GUICreate("Test GUI", 640,
我想使用 AutoIt 将变量发送到 GUI 的编辑控件。如何从命令行或使用 shellexecute 运行我的 AutoIt 脚本,以便它正确处理其命令行参数? 我在 AutoIt 脚本中使用以下语
我想在 AutoIt 中编写一个脚本,它可以从键盘自动输入 A-Z,无需用户干预。 这可能吗? 最佳答案 您的程序不太可能需要捕获所有按键的所有输入。如果您确实需要这种用户输入,AutoIt 可能不适
我的 AutoIt 脚本发送一系列点击和按键来自动化旧的闭源应用程序。 它有错误,所以我想知道如何调试 AutoIt 脚本。或者至少输出脚本的行号(以显示实时执行的代码)。 最佳答案 How can
我有两个文本框和一个按钮。如何在文本框中输入一个值,然后使用 AutoIt 按 Enter 按钮? 最佳答案 举个例子就这么简单: $gui = GUICreate("Test GUI", 640,
我在看官方AutoIt Array Parameters ,据我所知,你必须告诉 AutoIt 你的数组有多少元素,然后才能创建它。由于我的数组将根据用户在我的界面中选择的内容而动态变化,因此我需要这
我试过下面的代码,但我得到的是空值 $myDefaultBrowser = RegRead("HKEY_CURRENT_USER\Software\Clients\StartMenuInternet"
这个问题在这里已经有了答案: How to press "Ctrl+Shift+Q" in AutoIt (2 个答案) 关闭 4 年前。 我是 AutoIt 的新手。我在 AutoIt 中使用以下
我希望模拟右键单击文件。这是通过打开 Windows 资源管理器窗口然后右键单击它来完成的。 主要问题是在 Windows 资源管理器中查找文件的位置。我目前使用的是 Autoit v3.3.8.1。
好的,哎呀,这里有语法转换问题...我该如何在 AutoIt 中执行此操作? String theStr = "Here is a string"; String theNewStr = ""; fo
如何获取菜单中当前选中的项目?例如在记事本中。如何识别当前选中的是不是“字体...” 提前致谢! ShellExecute("notepad.exe") WinWaitActive("Untitled
我正在尝试使用 AutoIt 自动化一个应用程序,我需要等待一个控件出现在应用程序中,然后才能开始自动化。此控件在应用程序启动后不久加载,但不会更改窗口标题。如何等待控件出现? 最佳答案 要获得另一个
有没有办法在新行上继续执行命令?我的 MsgBox() 函数调用很长,为了可读性,我想做这样的事情: $confirm = MsgBox(321, "Check Information", "Conf
我无法在放大镜上添加十字准线。 This我的源代码是基于: #include $MagWidth = 50 $MagHeight = 50 $MagZoom = 3 Global $dll[3],
我正在使用 AutoIt3,我需要一种方法让用户选择一个窗口。在我看来,最快的方法是让它们指向一个窗口。那么问题来了,如何查看鼠标指针下的窗口是什么? 最佳答案 我从我为选择屏幕上的区域而放置的一些代
注意,脚本文件名不算进参数,如果要获得脚本文件名请查看关于 @ScriptName 的说明。如果某个参数中包含有空格字符则必须用英文“双引号”把这个参数围住。已编译的
关闭。这个问题是not reproducible or was caused by typos .它目前不接受答案。 这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topi
我是一名优秀的程序员,十分优秀!