Click here to Skip to main content
12,826,151 members (28,434 online)
Rate this:
Please Sign up or sign in to vote.
See more: MFC
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.

Posted 30-Sep-12 2:23am
Sergey Alexandrovich Kryukov 30-Sep-12 10:52am
OK, you want it, so what? This is not a question. You should not expect the answer because this whole approach does not make a whole lot of sense. All you need from DLL should be packed in the DLL itself. It could be access methods and everything else.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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,
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

What about implementing the IPropertyBag2 Interface[^]

Best regards
Espen Harlinn
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

hi dear friend
i think you can determine and compare those types with their size.
by sizeof() function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170326.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100