我有一组相互依赖的 Visual C++ 9 COM 组件项目。
ComponentA 将其类型库发布到ComponentA.tlb. ComponentB 导入ComponentA.tlb并ComponentB.idl发布ComponentB.tlb. 中的方法签名ComponentB.idl包含在中定义的类型的参数ComponentA.tlb。ComponentA 和 ComponentB 项目都可以编译。
ComponentC#import和into ComponentA.tlb-这突然失败了ComponentB.tlbstdafx.h
error C4772: #import referenced a type from a missing type library;
以及后来的一组
error C2440: 'return' : cannot convert from '__missing_type__ *' to '__missing_type__'
对于使用ComponentA.tlb. 通常在ComponentA.tlb未注册时会发生这种情况,但我肯定已经regtlib在 regedit 中运行并看到它已注册。ComponentA.tlb准确地存在于注册表中指定的路径上。
问题的根源是什么?如何解决问题?