【问题标题】:_Problem with generating PASCAL bindings file from PSDK IDL file_从 PSDK IDL 文件生成 PASCAL 绑定文件的问题
【发布时间】:2011-12-08 05:36:14
【问题描述】:

我试图从 PSDK 提供的 IDL 文件之一生成类型库,但是在 midl 会话成功完成时 (ERRORLEVEL 0) 没有生成 .tlb 文件。目前我不知道有什么问题。请指教。

这是一个详细的输出表单midl session:

>midl emptyvc.idl /tlb .\emptyvc.tlb /I "\Program Files\Microsoft SDKs\Windows\v7.0\Include" /W4
Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555
Copyright (c) Microsoft Corporation. All rights reserved.
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\emptyvc.idl
emptyvc.idl
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl
objidl.idl
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\unknwn.idl
unknwn.idl
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\wtypes.idl
wtypes.idl
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\basetsd.h
basetsd.h
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\guiddef.h
guiddef.h
\Program Files\Microsoft SDKs\Windows\v7.0\Include\wtypes.idl(671) : warning MIDL2111 : identifier length exceeds 31 characters : STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2308) : warning MIDL2111 : identifier length exceeds 31 characters : FMTID_MediaFileSummaryInformation
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2499) : warning MIDL2111 : identifier length exceeds 31 characters : tagEOLE_AUTHENTICATION_CAPABILITIES
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2518) : warning MIDL2111 : identifier length exceeds 31 characters : EOLE_AUTHENTICATION_CAPABILITIES
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2616) : warning MIDL2111 : identifier length exceeds 31 characters : tagRPCOPT_SERVER_LOCALITY_VALUES
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2652) : warning MIDL2111 : identifier length exceeds 31 characters : COMGLB_EXCEPTION_DONOT_HANDLE_FATAL
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2653) : warning MIDL2111 : identifier length exceeds 31 characters : COMGLB_EXCEPTION_DONOT_HANDLE_FATAL
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2654) : warning MIDL2111 : identifier length exceeds 31 characters : COMGLB_EXCEPTION_DONOT_HANDLE_ANY
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2660) : warning MIDL2111 : identifier length exceeds 31 characters : COMGLB_RPC_THREADPOOL_SETTING_DEFAULT_POOL
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(2661) : warning MIDL2111 : identifier length exceeds 31 characters : COMGLB_RPC_THREADPOOL_SETTING_PRIVATE_POOL
\Program Files\Microsoft SDKs\Windows\v7.0\Include\objidl.idl(3359) : warning MIDL2111 : identifier length exceeds 31 characters : APTTYPEQUALIFIER_NA_ON_IMPLICIT_MTA
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\oleidl.idl
oleidl.idl
\Program Files\Microsoft SDKs\Windows\v7.0\Include\oleidl.idl(329) : warning MIDL2111 : identifier length exceeds 31 characters : OLEMISC_RENDERINGISDEVICEINDEPENDENT
\Program Files\Microsoft SDKs\Windows\v7.0\Include\oleidl.idl(339) : warning MIDL2111 : identifier length exceeds 31 characters : OLEMISC_IGNOREACTIVATEWHENVISIBLE
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\oaidl.idl
oaidl.idl
Processing \Program Files\Microsoft SDKs\Windows\v7.0\Include\oaidl.acf
oaidl.acf
\Program Files\Microsoft SDKs\Windows\v7.0\Include\emptyvc.idl(108) : warning MIDL2392 : [local] procedure without [call_as] : [ Procedure 'Initialize'  ]
\Program Files\Microsoft SDKs\Windows\v7.0\Include\emptyvc.idl(157) : warning MIDL2392 : [local] procedure without [call_as] : [ Procedure 'InitializeEx'  ]
** ERRORLEVEL is 0 at this point **

使用的零件和工具:

  • 未修改来自 Windows SDK 7.0 版的 emptyvc.idl
  • MIDL 版本 7.00.0555
  • CL 版本 14.00.50727.42

注意:我相信这不是环境问题,因为我尝试的第一件事是编译其他 .idl 文件,我得到了预期的结果 .tbl,然后由TLIBIMP 处理,没有任何问题。


这是 CL 输出(由 MIDL 运行,完全静音):

dlldata.c
dlldata.c(24) : error C2061: syntax error : identifier 'PROXYFILE_LIST_START'
dlldata.c(24) : error C2059: syntax error : ';'
dlldata.c(31) : error C2146: syntax error : missing ';' before identifier 'DLLDATA_ROUTINES'
dlldata.c(38) : fatal error C1004: unexpected end-of-file found

【问题讨论】:

  • 您问题的DelphiPascal 部分在哪里? AFAICT,这完全是一个MIDL 问题。除了在标签中没有提到Delphi,除了在标题中没有提到Pascal

标签: delphi idl typelib platform-sdk


【解决方案1】:

MIDL 有一个有点烦人的习惯,即如果没有可生成的内容,则不生成输出。您是否确认 emptyvc.idl 文件中包含可以在类型库中表示的类型(类、接口、库指令等)?

【讨论】:

  • 嗯,有人删除了 [delphi] 标签,该标签注定要表明我有点 MSVC n00b。不,我没有确认,但.idl 文件看起来对我非常n00bish 的眼睛非常有效。目前,我弄清楚了正在生产什么中间 .c.h,然后 midl 在它们上运行完全静音 cl,这反过来又导致预处理步骤失败。
  • 更新了 CL 端的 Q。您是否知道可能导致问题的原因、CL 或输入 .idl 文件(PSDK 比 MS C 编译器更新)?
  • .idl 文件是否包含一个库块,其名称中包含类?
  • 你的意思是像微软对 IDL 的扩展中的库吗?看起来那里没有这样的块,无论如何,这是一个完整的 IDL 源:pastebin.com/kxD6YgbF 看起来有效,但导致 dlldata.c 无法编译,我粘贴在上面的输出。
  • 我必须查看源代码,但我不相信 MIDL 会在 IDL 文件中没有“库”指令的情况下发出 tlb 文件。
猜你喜欢
  • 2018-11-10
  • 1970-01-01
  • 2011-06-17
  • 2011-03-16
  • 1970-01-01
  • 2018-03-20
  • 1970-01-01
相关资源
最近更新 更多