Return map<cstring,> from com atl????
-
Hi all, I've created simple ATLproject from VS2008 and added a simple object. The object should return the map<> collection through interface method. How can I do this? Maybe I should use SAFEARRAY? :^) If it is possible please point me to the article about using this.
-
Hi all, I've created simple ATLproject from VS2008 and added a simple object. The object should return the map<> collection through interface method. How can I do this? Maybe I should use SAFEARRAY? :^) If it is possible please point me to the article about using this.
This question shows you don't understand COM properly: you can't return a
std::map
from a COM interface method.Steve
-
Hi all, I've created simple ATLproject from VS2008 and added a simple object. The object should return the map<> collection through interface method. How can I do this? Maybe I should use SAFEARRAY? :^) If it is possible please point me to the article about using this.
To expand (slightly) on what Stephen's said - you can't return a
std::map
from a COM object. Instead, you would probably return anIEnumXXXX
interface that allowed the user of your object to iterate over themap
contents (see this article[^] for more details). However, I would suggest you get comfortable with COM & ATL first before trying a more advanced topic like this -
To expand (slightly) on what Stephen's said - you can't return a
std::map
from a COM object. Instead, you would probably return anIEnumXXXX
interface that allowed the user of your object to iterate over themap
contents (see this article[^] for more details). However, I would suggest you get comfortable with COM & ATL first before trying a more advanced topic like thisThanks for help, I found the following article on MSDN about collections http://msdn.microsoft.com/en-us/library/3stwxh95(VS.71).aspx and tried. All works fine.
-
Thanks for help, I found the following article on MSDN about collections http://msdn.microsoft.com/en-us/library/3stwxh95(VS.71).aspx and tried. All works fine.
How about returning the value as one of the out parameter...