预定义的IDL FILE中没有类型定义 [英] No type definitions in pre-defined IDL FILE
问题描述
首先,
使用普通 C ++,而没有ATL,MFC尝试使用COM Object接口.
Using plain C++, without ATL, MFC attempting to use COM Object interface.
使用 oleview (OLE/COM对象查看器)-用于设计IDL代码.
Using oleview (OLE/COM Object viewer) - used to engineer the IDL code.
在此阶段,使用 MIDL 编译器,现在我在尝试生成以下内容时遇到麻烦:
At this stage, using MIDL Compiler, now I'm having trouble trying to produce the following:
cmd行上的语法:
midl/nologo/env win32/tlb.\ S8_.tlb"/h.\ S8_.h"/iid.\ S8_i.c" S8.idl
midl /nologo /env win32 /tlb ".\S8_.tlb" /h ".\S8_.h" /iid ".\S8_i.c" S8.idl
- 对应的.TLB(类型库)
- .H(标题)
- IID定义包括文件(* _i.c)
- 代理(* _p.c)
- A corresponding .TLB (Type Library)
- A .H (header)
- An IID definitions include file (*_i.c)
- A proxy (*_p.c)
MIDL编译器错误:
MIDL compiler error:
S8.IDL(513):错误MIDL2025:语法错误:期望在"S8SimObject"附近输入类型规范
S8.IDL(513) : error MIDL2025 : syntax error : expecting a type specification near "S8SimObject"
HRESULT LinkSimObjects(
[in] S8SimObject* SourceObject, ####line 513 ####
[in] S8SimObject* DestObject,
[in] float TravelTime);
推荐答案
MIDL编译器错误
S8.IDL(513):错误MIDL2025 :语法错误:在"S8SimObject"
MIDL compiler error
S8.IDL(513) : error MIDL2025 : syntax error : expecting a type specification near "S8SimObject"
在IDL文件的顶部添加前向声明-
Add a forward declaration - at the TOP of IDL file:
- 导入"ocidl.idl";
- 接口S8SimObject;
这篇关于预定义的IDL FILE中没有类型定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!