简体   繁体   English

如何在Linux中使用COM ATL项目?

[英]How can I use COM ATL project in Linux?

I've got a small C++ library which is made as ATL Project in Visual Studio. 我有一个小的C ++库,它是在Visual Studio中作为ATL项目制作的。 I want to make it crossplatfrom. 我想使其跨平台。 It will be used in Windows and Linux. 它将在Windows和Linux中使用。 It will be included in my project, which uses Qt 4.x. 它将包含在使用Qt 4.x的我的项目中。 How can I easily convert the library? 如何轻松转换库?

Short answer: Not easily. 简短答案:不容易。

Long answer: The COM technology is an exclusively Windows technology and ATL is built on top of it. 长答案:COM技术是Windows独有的技术,而ATL是在此基础上构建的。 That means you can not compile/run it under linux, except if you use Wine or something similar. 这意味着您不能在Linux下编译/运行它,除非您使用Wine或类似的东西。

Here's what you can do: You can switch to XPCOM - a cross platform implementation of COM technology, implemented by the Mozilla platform. 可以执行以下操作:可以切换到XPCOM-由Mozilla平台实现的COM技术的跨平台实现。 COM and XPCOM are binary compatible under Windows (but only if used from XPCOM - MS Windows COM is agnostic of Mozilla's XPCOM). COM和XPCOM在Windows下是二进制兼容的(但仅在XPCOM中使用-MS Windows COM与Mozilla的XPCOM无关)。

I am unsure if you would be able to compile any ATL code using XPCOM instead of COM as a base though (but I doubt it), and if you go with XPCOM, you're better off using an XPCOM GUI (using the same code that Mozilla/Firefox does), instead of Qt. 我不确定您是否能够使用XPCOM而不是COM作为基础来编译任何 ATL代码(但我对此表示怀疑),并且如果您选择XPCOM,则最好使用XPCOM GUI(使用相同的代码) Mozilla / Firefox所做的),而不是Qt。

This would mean implementing your GUI using Javascript and XUL . 这意味着使用Javascript和XUL实现GUI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM