I've not found some example that really works. I need to create an interaction system for MetaTrader. It's better to use modern technologies like WCF or somehting else using C#, but MetaTrader doesn't support COM or just OOP at all. So I need some gateway component that must be functions library with non-object interface. Surely, it requires usage of C++. But I'm not succeeded to find over the Web some example how to call from a C++ functions library a C# COM+ DLL. All the examples I could find use component C++ assemblies that are not supported by MetaTrader. So, I can't use namespace, etc. in C++. I wrote a COM+ server application that is easy to call from C# by the following lines
object c2 = Activator.CreateInstance(Type.GetTypeFromProgID("Imutome.COMPlusCache.Cache"));
c2.GetType().InvokeMember("OnTransfer", BindingFlags.InvokeMethod, null, c2, null);
But when I'm trying to write in C++ something like this
CLSIDFromProgID(OLESTR("Imutome.COMPlusCache.Cache"), &rclsid);
HRESULT hres = CoCreateInstance(rclsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void **)&ppv);
I get just zeros in ppv and "0x80040154 Class not registered" in hres. I'm not sure what flags or what interface are required but I get the same error whatever I try. Although in C# everything works. Tell me please what do I need to change to make C++ succesfully create a COM+ object instance.
CLSIDFromProgID()actually retrieve the right class id?