C ++ COM \ DOS版本管理 [英] C++ COM\DCOM version management

查看:101
本文介绍了C ++ COM \ DOS版本管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常古老的问题,但由于一些API问题,我真的很喜欢它。



我正在使用一些桌面应用程序API谁的版本更改每个每个月都有新功能。让我们考虑下面的场景,A公司ABC LTD现在介绍一个窗口应用程序ABCPRO,当他们介绍它们没有版本1.0.0.0的com支持时,ABCPRO没有com API。现在公司进步并推出ABCPRO 1.0.0.1的新版本,即使这个版本他们也没有com支持。在ABCPRO的一些测试版发布后,他们最终在2.0.0.0版本中为ABCPRO引入了com支持。



现在很高兴我们获得ABCPRO API并做一些功能。在版本2.0.0.0下,版本很有用。



现在在版本2.0.0.1中,他们引入了另一个功能,例如LMN,并且对我们有用。因此我们删除ABCPRO 2.0.0.0并安装ABCPRO 2.0.0.1.Things对我们所有的2.0.0.1客户都很有用,但是当我们的客户有ABCPRO 2.0.0.0所以我的可执行程序崩溃在ABCPRO 2.0.0.0存在的机器上,因为我使用2.0.0.1开发可执行文件。



那么如何摆脱这个问题版本控制,因为我在功能上知道有很多版本的ABCPRO将会引入我们需要的功能,但所有旧版本呢?????



以下代码可能c了解你。



This is may be very old problem but i really fustrating with same due to some API issues.

I am using some Desktop application API who's version changes each and every month with new feature. Lets consider following scenario, A Company ABC LTD introduce one window application ABCPRO now when they introduce it they dont have com support that is in version 1.0.0.0 the ABCPRO dont have com API. Now company progress and introduce new version of ABCPRO 1.0.0.1 , even this version they dont have com support.After some beta releases of ABCPRO in 1.* they finally introduce com suport for ABCPRO in version 2.0.0.0.

now its pleasure for us to get ABCPRO API and do some functionality.things works great with version 2.0.0.0.

Now in version 2.0.0.1 they introduce one more feature say LMN and which userful to us.so we remove ABCPRO 2.0.0.0 and install ABCPRO 2.0.0.1.Things work great for all our 2.0.0.1 customers but it fails when our customer have ABCPRO 2.0.0.0 So my executable crash on machine where ABCPRO 2.0.0.0 is present because i develop executable using 2.0.0.1.

So how to come out of this problem of versioning because i known in feature there are lots of versions of ABCPRO are going to be introduced with the feature that we needed but what about all old versions?????

Following code may clear you.

int main()
{
   IABCPROAPI ABCPRO;
   VARIANT var;
   ABCPRO->GetNameOfServer(&Var);
   VARIANT LMNVar;
   ABCPRO->GetLMN(&LMNVar);             //This introduce in version 2.0.0.1
}

推荐答案

在COM中你应该使用 QueryInterface [ ^ ]以确保方法在您尝试使用之前可用。
In COM you should use QueryInterface[^] to ensure a method is available before you try to use it.


这篇关于C ++ COM \ DOS版本管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆