2

是否可以禁止 MIDL 编译器在生成的 COM dll 构建中将自定义属性附加到生成的接口定义?我怀疑 MIDL 编译器附加的属性会使我们的 dll 失败并导致错误:“自动化服务器无法创建对象”,因为它插入了字符串值属性。这些信息由 Oleview.exe 的 Itypelib 查看器提取。

// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: <could not determine filename>
[
   uuid(3F452555-ABB7-402C-BDBA-185B2F71C800),
  version(1.0),
  custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 117441067),   custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1433773761), custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, "Created by MIDL         version     7.00.0555 at Mon Jun 08 22:29:18 2015
")

这是我们 dll 工作版本的定义,也是我在使用带有 MIDL 版本 8 的 Visual Studio 2013 时打算复制的内容。

// Generated .IDL file (by the OLE/COM Object Viewer)
// 
// typelib filename: <could not determine filename>
[
  uuid(3F452555-ABB7-402C-BDBA-185B2F71C800),
  version(1.0),
  custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 117441067),
  custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1433773761)
]
4

0 回答 0