DLL 调用约定有误(错误 49)

传递给动态链接库 (DLL) 或 Macintosh 代码资源例程的参数必须完全符合例程的预期。 调用约定涉及数量、类型和参数的顺序。 此错误具有以下原因和解决方案:

  • 您的应用程序正在调用 DLL(在 Windows 中)或代码资源(在 Macintosh 上)中的例程,向该例程传递的参数类型错误。 确保所有参数类型与您调用的例程的声明中指定的类型一致。

  • 您的应用程序正在调用 DLL(在 Windows 中)或代码资源(在 Macintosh 上)中的例程,向该例程传递的参数数量错误。 确保传递与您调用的例程的声明中指示的数量相同的参数。

  • Your program is calling a routine in a DLL, but isn't using the StdCall calling convention. If the DLL routine expects arguments by value, then make sure ByVal is specified for those arguments in the declaration for the routine.

  • Your Declare statement for a Windows DLL includes CDecl. The CDecl keyword applies only to the Macintosh.

有关其他信息,选择有问题的项并按 F1(在 Windows 中)或 HELP(在 Macintosh 上)。

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。