用于获取和设置的通用接口 [英] Genereic Interface for get and set
本文介绍了用于获取和设置的通用接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想要一个用于设置和获取com dll不同值的接口.
该值可以是任何数据类型,即它支持int,char,long,short,string.
任何人都可以建议如何处理此问题.
我知道我们不能将虚拟模板功能或接口作为模板.
任何想法都受到高度赞赏.
提前谢谢.
问候,
Durga
Hi all,
I want to have an interface for setting and getting the different value from/to com dll.
The value can be of any datatype, i,e it support int, char, long, short, string.
Can any one suggest how to handle this.
I know we cant have virtual template function or interface as a template.
Any idea is highly appreciated.
Thanks in advance.
regards,
Durga
推荐答案
请参阅我对问题的评论.考虑一下这是一个答案:您想要的没有任何意义.
这是一种查看方法:如果您需要这种通用的访问方式,则它已嵌入DLL中.如果要开发这种东西,则需要开发一些体系结构,例如插件体系结构,在该体系结构中一组不同的DLL应该实现相同的一个或多个接口.如果不是这种情况,或者类似的情况,那么您的我想要"将不是很有效:-).
如果您有一些不同的模糊概念,则仍应更具体.如果您能解释这样的事情,我会很乐意与您讨论.
祝你好运,
-SA
Please see my comment to the question. Consider this as an answer: what you want makes no sense.
This is a way to look at this: if you need such a universal way of access, it is already embedded in the DLL. If you want to develop such thing, you need to develop some architecture, such as plug-in architecture, where a set of different DLLs should implement the same interface (or interfaces). If this is not the case, or a similar case, your "I want" would be not very productive :-).
If you have some different vague ides, it still should be more specific. If you can explain such thing, I''ll gladly discuss it with you.
Good luck,
—SA
有关实现 ^ ]
最好的问候
Espen Harlinn
What about implementing the IPropertyBag2 Interface[^]
Best regards
Espen Harlinn
亲爱的朋友
我认为您可以确定这些类型并将其与它们的大小进行比较.
通过 sizeof()函数.
hi dear friend
i think you can determine and compare those types with their size.
by sizeof() function.
这篇关于用于获取和设置的通用接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文