I am attempting to use a C# application to interact with COM+. I am able to create an instance of the object, but when I attempt to use an interface I get the following: QueryInterface failed Unspecified error 0x80004005 (E_FAIL).
I will attempt to outline the steps that I have used to get to this point.
First I took an IDL file that contained a bunch of interfaces. Next I used VS2010 to build a type library file. From here, I used tlbimp.exe to create a primary interop dll. Because I was using a bool type in my IDL and it did not properly convert into my
tlb file, I had to disassemble the dll and convert one of the method signatures to use type bool. Next I reassembled the dll and started using it in my C# program that actually defines the interfaces.
I next created a C# service that defined all of the interfaces after referencing the interop dll. The resulting dll then got registered using regsvcs. Using OleView I am able to create an instance of my COM+ object.
Everything appears to be working correctly up to this point. I have examined my registry and all the entries look correct. When I create a test application to start using these newly defined methods, I start having issues. I am able to create an instance
of my interface, but I am unable to query the interface.
When I call GetTypeFromProgID and then GetInterfaces, I see IRemoteDispatch and IManagedObject as opposed to the interfaces inside my class. I think that may be why I have an unknown error, but I am not sure if this should be my expected results. Any
help would be greatly appreciated.