开发者

How to compile a .dll for MSHTML v9. I'm currently getting 100s of "MIDL 2035: constant expression expected" errors

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! :)


#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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜