George2

Hello everyone,


I am a developer from C++ COM to C# COM. I feel confused about the entry point function for a C# COM object.

In C++, we always initialize object through GetClassObject or DLLGetClassObject, but it seems C# does not need these functions

Here is a sample from MSDN.

http://msdn2.microsoft.com/en-us/library/aa645738(VS.71).aspx

So, in C# do we need to implement the required functions like GetClassObject If no need, which function is the entry point for C# COM object -- I want to find the entry point function so that I can verify that my C# COM object can begin to talk with other COM clients.


thanks in advance,
George



Re: Visual C# General C# COM entry point function

Derek Smyth

Hi George,

I'm sorry but I don't know the answer but thought I'd post to let you know about a free COM .NET Interop ebook that I found.

http://dotnetslackers.com/community/blogs/dsmyth/archive/2007/06/05/Book-on-.NET-Interop.aspx

Its very good and if your doing work with COM and .NET then, if you don't already have it, it's a must. Good luck with your problem.






Re: Visual C# General C# COM entry point function

Peter Ritchie

You cannot write an "export" in a .NET assembly. Managed code has to run through the framework, it can't do that with programmer-written entry-points. All the COM support is handled internally by the Framework. Don't rely on it doing anything specific other than supporting creation of managed objects as COM objects.




Re: Visual C# General C# COM entry point function

George2

Thanks Peter , I have learned some materials and I found that there is no need to write function like DllGetClassObject, and in C# COM, this function is generated automatically and the entry point is through mscoree.dll, right

Peter Ritchie wrote:
You cannot write an "export" in a .NET assembly. Managed code has to run through the framework, it can't do that with programmer-written entry-points. All the COM support is handled internally by the Framework. Don't rely on it doing anything specific other than supporting creation of managed objects as COM objects.

regards,

George





Re: Visual C# General C# COM entry point function

George2

Thanks Derek! A good book!

Derek Smyth wrote:

Hi George,

I'm sorry but I don't know the answer but thought I'd post to let you know about a free COM .NET Interop ebook that I found.

http://dotnetslackers.com/community/blogs/dsmyth/archive/2007/06/05/Book-on-.NET-Interop.aspx

Its very good and if your doing work with COM and .NET then, if you don't already have it, it's a must. Good luck with your problem.

regards,

George