如何为 MSHTML v9 编译 .dll。我目前正在获取数百个“MIDL 2035:预期的常量表达式”错误

发布于 2024-11-19 11:38:03 字数 1153 浏览 16 评论 0原文

我是一名 .net 开发人员,我正在尝试为 MSHTML v9 编译 .tbl 和 .dll,以便在我的 .net 应用程序中使用。

我发现以下有关构建 MSHTML v8 .dll 的说明:

start menu -> Windows SDK 7.1 Command Prompt 

cd c:\temp
midl "C:\Program Files (x86)\Microsoft SDKs\Internet Explorer\v8\include\mshtml.idl"
tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml /asmversion:8.0

上面的内容非常适合 MSHTML v8 但是当我尝试使用 MSHTML 执行相同操作时v9 尝试运行时,我收到数百个“错误 MIDL 2035:需要常量表达式”错误:

midl "C:\Program Files (x86)\Microsoft SDKs\Internet Explorer\v9\include\mshtml.idl"

关于为什么 MSHTML v9 无法构建的任何线索?我认为这一定是我的环境,我运行的是 Windows 7 64x Ultimate,并且安装了 VS2010 Ultimate 和 Windows SDK 7.1。我的 PATH 变量中有以下相关路径:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin

非常感谢任何帮助,谢谢! :)

I'm a .net developer and I'm trying to compile a .tbl and .dll for MSHTML v9 for use in my .net applications.

I found the following instructions for building a MSHTML v8 .dll:

start menu -> Windows SDK 7.1 Command Prompt 

cd c:\temp
midl "C:\Program Files (x86)\Microsoft SDKs\Internet Explorer\v8\include\mshtml.idl"
tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml /asmversion:8.0

The above works great for MSHTML v8 but when I try the same thing with MSHTML v9 I get 100s of "error MIDL 2035: constant expression expected" errors when trying to run:

midl "C:\Program Files (x86)\Microsoft SDKs\Internet Explorer\v9\include\mshtml.idl"

Any clues on why the MSHTML v9 will not build? I assume it must be my environment somehow, I'm running Windows 7 64x Ultimate and have VS2010 Ultimate and have Windows SDK 7.1 installed. I have the following relevant paths in my PATH variable:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin

Any help is vary much appreciated, thanks! :)

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

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

发布评论

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

评论(1

两相知 2024-11-26 11:38:03
#include <mshtmdid.h>
#include <mshtmcid.h>
#include <olectl.h>

mshtml.idl 中的前几行。 mshtmdid.h 头文件定义常量。此文件也存在于 Windows SDK 包含文件夹中,但这是旧版本。您需要更正 INCLUDE 环境变量,以便它首先在 Internet Explorer\v9\include 目录中查找。使用 SET INCLUDE。

#include <mshtmdid.h>
#include <mshtmcid.h>
#include <olectl.h>

First couple of lines from mshtml.idl. The mshtmdid.h header file defines the constants. This file is also present in the Windows SDK include folder but that's an old version. You need to correct the INCLUDE environment variable so it looks in the Internet Explorer\v9\include directory first. Use SET INCLUDE.

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