导出为固定格式

发布于 2024-10-04 08:20:55 字数 497 浏览 0 评论 0原文

为什么下面的代码返回无效参数错误? Delphi 中的等效项执行得很好。

C++ 生成器:

ActiveWorkSheet.OleProcedure("ExportAsFixedFormat", 0, EmptyParam,
        EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
        EmptyParam);

Delphi:

  oSheet.ExportAsFixedFormat(0, // xlTypePDF is constant 0
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, // set to True to open Acrobat
    EmptyParam);

Why the following code return invalid parameter error? Its equivalent in Delphi executes well.

C++ Builder:

ActiveWorkSheet.OleProcedure("ExportAsFixedFormat", 0, EmptyParam,
        EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
        EmptyParam);

Delphi:

  oSheet.ExportAsFixedFormat(0, // xlTypePDF is constant 0
    EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
    EmptyParam, // set to True to open Acrobat
    EmptyParam);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱本泡沫多脆弱 2024-10-11 08:20:55

添加另一个 EmptyParam。该函数有 9 个参数,因此当您使用 OleProcedure 调用它时,您必须发送 10 个参数(因为第一个参数是函数名称)。你只发送了 9 个。

Add another EmptyParam. The function has 9 parameters so when you call it using OleProcedure you mush send 10 parameters (since the first parameter is the function name). You're only sending 9.

不打扰别人 2024-10-11 08:20:55

在 C++ 中(至少在 VC 中)参数顺序必须颠倒。试试这个:

ActiveWorkSheet.OleProcedure("ExportAsFixedFormat", EmptyParam,
空参数,空参数,空参数,空参数,空参数,空参数,
空参数, 0);

希望这会有所帮助

In C++ (at least in VC) the parameter order have to be reversed. Try this:

ActiveWorkSheet.OleProcedure("ExportAsFixedFormat", EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, 0);

Hope this would help

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文