Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++/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.

regards,
Durga
Posted 30-Sep-12 2:23am
Comments
Sergey Alexandrovich Kryukov at 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.
--SA
Rate this: bad
good
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 Smile | :) .
 
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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

What about implementing the IPropertyBag2 Interface[^]
 
Best regards
Espen Harlinn
  Permalink  
Rate this: bad
good
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.
  Permalink  

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



Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2015
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