Hi,
I am new to COM as well as to .Net COM interop. I want to expose a .Net
class(lets say (lets say A::ClassA) of an assembly (A ) to COM with a method
that returns an Object of another .Net class(B::ClassB). The problem is
ClassB has been defined in another assembly (B) that the assembly A refers
to. ( And Class B itself derives from 2 interfaces and a class all defined in
separate assemblies)
First of all is this possible? If yes will only exposing the Assembly A by
generating its type library and registering it through .Net's COM interop
utilities such as regasm?
I have tried using Regasm but it is giving some errors ( fails to load the
types from the referenced assembly, although i have copied all the required
assemblies to the same location as the assembly A).
I will be using this COM interface from a .NET assembly, but have to use COM
component's progid to instantiate an Object. ( a really twisted kind a
problem, ;) nice warm welcome to the interop world right?)
Anyway, Another option that came to mind was to somehow marshal the COM
object back to an object of the original class ( whose type i can access by
referencing to the .Net assembly A. now i can use a method that hasn't been
exposed through the class A's interface. This method wont give any errors
while registering the assembly. I want to know if its actually possible.
If there is any confusion i would happily elaborate it. Any Help would be
appreciated.
Thanks
Patrick Steele - 21 Feb 2007 21:45 GMT
> I am new to COM as well as to .Net COM interop. I want to expose a .Net
> class(lets say (lets say A::ClassA) of an assembly (A ) to COM with a method
[quoted text clipped - 4 lines]
>
> First of all is this possible?
It should be possible. As long as you have GUIDs, interfaces, DISP ids,
etc... all set up properly. I wrote an article on how to expose your
.NET objects to COM that might help you out:
http://www.15seconds.com/issue/040721.htm

Signature
Patrick Steele
http://weblogs.asp.net/psteele
AsharGhani - 12 Mar 2007 13:47 GMT
Thanks Patrick Steele!
will have a look at the article