главная продукты downloads форум тех. поддержка

 

Главная страница

Interoperability COM

FAQ Home

1. How do you invoke a COM Class in a specific COM DLL in .Net?
2. How do you make .Net components that could be used by COM?
3. How can I read and display Excel files from within my C# application?
4. Should I try to use Interoperability or migration to use COM with .NET?
5. How can I get events fired by an Office XP chart control hosted in my Windows Forms app?
 



1 How do you invoke a COM Class in a specific COM DLL in .Net?

Imtiaz Alam discusses both early and late binding techniques in his article entitled Accessing COM+ component using C# on C# Corner.
 



2 How do you make .Net components that could be used by COM?

The tool Regasm.exe can create a COM typelib and creates the necessary entries in the registry (the CLSID and Typelib ). If only a typelib is required, you can use tlbexp.exe. A com callable wrapper (CCW) will be created when a COM client (VB, VBS, JS, C++ etc.) creates an instance of a (managed) class. Posted on C# Corner.
 



3 How can I read and display Excel files from within my C# application?

.NET's interoperability makes it easy to work with COM Capable Applications such as Word and Excel.
See Mike Gold's article on C# Corner for a detailed discussion.
 



4 Should I try to use Interoperability or migration to use COM with .NET?

John Godel tackles this question through a lengthy article on C# Corner. In it, he discusses the basics (and more) of both .NET Interoperability and Migration.
 



5 How can I get events fired by an Office XP chart control hosted in my Windows Forms app?

To get these events instead of using event delegates, you can create a sink for the events by using the IConnectionPointContainer and IConnectionPoint interfaces of the Spreadsheet/Chart component. Here are two articles that you can check:


HOWTO: Handle Office XP Spreadsheet Events in Visual C# .NET http://support.microsoft.com/support/kb/articles/q319/3/41.asp
HOWTO: Handle Office XP Chart Events in Visual C# .NET http://support.microsoft.com/support/kb/articles/q319/3/41.asp


Reply posted by Elan Zhou (MS) in microsoft.public.dotnet.framework.windowsforms.

 

e-mail:

 

bousoft@mail.ru