I use in my C++ COM server a C# COM DLL that implements IEnumerable for iterating over a collection.
How do I specify in my native code that I want to access IEnumerable -> GetEnumerator() method from the instance object of C# Dll ? Do I have to import some *.tlb in order to see IEnumerable interface in my C++ project ? Ienumerable interface I saw is defined by mscorelib.dll
Can I further expose an IEnumerable interface to my clients (defined in IDL in my C+ project). An example would be helpful
It is automatically translated by the type library exporter, System.Collections.IEnumerator is [ComVisible] and gets translated to IEnumVARIANT. For example:
Gets translated to this type library fragment:
Note the importlib directive for mscorlib.tlb, present in c:\windows\microsoft.net\framework\v2.0.50727 and found by the compiler without help.