tlibimp.exe 输出在不同操作系统上有所不同
我正在尝试使用 tlibimp.exe(版本 11.0)导入第三方 .NET 类型库(COM 服务器 DLL)。这基本上工作得很好,但是当我在不同的计算机上运行它时,结果有所不同,一台运行Windows XP,另一台运行Windows 7。更糟糕的是,在Win7机器上生成的代码无法编译。
两台机器都安装了:
- Borland C++ (RAD Studio) 2007
- tlibimp.exe 版本 11.0
- 安装了相同的 .NET Framework 版本(据我所知, Borland 2007 使用 .NET v2)
- bcc32.exe 版本 5.93
编译器在 OCX.h 中失败:
Parameter mismatch in write access specifier of property Font
XP 机器上的相关代码行(编译正常)是:
__property Graphics::TFont * Font={ read=GetTFontProp, write=_SetTFontProp, stored=false, index=-512 };
Win7 机器上的同一行(失败)是:
__property IFontDisp* Font={ read=get_Font, write=set_Font, stored=false };
现在我不太确定这种差异从何而来。有什么想法吗?
干杯 亨德里克
I'm trying to import a third-party .NET type library (COM server DLL) using tlibimp.exe (version 11.0). This basically works fine, but the results differ when I run it on different computers, one running Windows XP, the other Windows 7. What's worse, the code generated on the Win7 machine doesn't compile.
Both machines have:
- Borland C++ (RAD Studio) 2007
- tlibimp.exe version 11.0
- the same .NET framework versions installed (as far as I can tell,
Borland 2007 uses .NET v2) - bcc32.exe version 5.93
The compiler fails in the OCX.h with:
Parameter mismatch in write access specifier of property Font
The relevant line of code on the XP machine (which compiles ok) is:
__property Graphics::TFont * Font={ read=GetTFontProp, write=_SetTFontProp, stored=false, index=-512 };
The same line on the Win7 machine (which fails) is:
__property IFontDisp* Font={ read=get_Font, write=set_Font, stored=false };
Now I'm not really sure where this difference comes from. Any ideas?
cheers
Hendrik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能有帮助,也可能没有帮助,但我在尝试从 C Sharp 程序集将两个类型库导入 Delphi 时遇到了类似的问题。
一个类型库 (A) 从 TOLeServer 继承,另一个 (B) 从 TOleControl 继承,我不明白为什么,因为生成类型库的两个程序集实际上是相同的。
结果发现,B 已经登记了重高潮,而 A 却没有。注册 A 并重新生成类型库解决了该问题。
This may or may not help but I had a similar issue trying to import two type libraries into delphi, from c sharp assemblies.
One type library (A) inherited from TOLeServer, the other (B) from TOleControl and I couldn't see why, as both assemblies which generated the type libraries were virtually identical.
The issue turned out to be that B had been registered with regasm and A hadn't. Registering A and re-generating the type library solved the issue.