ZDNet UK


Skip to Main Content

ZDNet.co.uk - Winner of Best Business Website 2007
  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Jobs
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


Application development Toolkit

COM and .Net interoperability

S. Vikram Builder.com

Published: 21 May 2002 15:18 BST

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

Interoperability using Visual Studio.Net
Let's assume we need to utilise Microsoft Excel in our application. We can do so by accessing the Project menu and References and choosing Microsoft Excel Object Library from the COM tab, as shown in Figure B.


Figure B
Choosing the Microsoft Excel Object Library

As soon as we do so, Visual Studio.Net automatically generates an RCW. The naming convention followed is Interop.COMObject.dll. In this case, the RCW is called Interop.Excel.dll, which is referenced in the .Net application; we can instantiate and use Excel objects in code. The same is true for any custom COM component authored by you. The only requirement is that the COM component must be registered.

You can also use ActiveX Controls from .Net. To do so, right-click on the Toolbox and select Customise Toolbox. From the COM Components tab, select (for example) Microsoft ListView Control and check the checkbox beside it (see Figure C). The Listview control will be added to the Toolbox.


Figure C
Selecting the Microsoft ListView Control

As soon as you place the Listview control on the form, Visual Studio.Net generates the RCW for the ActiveX Control. The naming convention followed is AxInterop.ActiveXControl.dll, so in this case it is called AxInterop.MSComctlLib.dll.

  • Email
  • Trackback
  • Clip Link
  • Print friendlyPrint with Konica

Did you find this article useful?
115 out of 224 people found this useful


Full Talkback thread

1 comment

  1. It would be nice to access your site without that... Keith Hamilton

Company/Topic Alerts

Create a new alert from the list below:













Discussions

roger andre roger andre

Skype Spying Debacle

Sunday 12 October 2008, 6:43 PM

1 comment
bagalibaba bagalibaba

CHEAP SELL, TOP QUALITY

Sunday 12 October 2008, 4:12 PM

1 post
bagalibaba bagalibaba

CHEAP SELL, TOP QUALITY

Sunday 12 October 2008, 3:35 PM

1 post
bagalibaba bagalibaba

CHEAP SELL, TOP QUALITY

Sunday 12 October 2008, 3:32 PM

1 post

Featured Talkback

In association with Intel
The fact is: Software developers today are really designers and not coders. The reason that business anlaysts exist today to model solutions is because they understand the value of designing software before writing it. All too often developers create code that has little value because they do not understand that business classes interact with other classes within the confines of a working model or pattern.

By: 1000165269

Read full story:
Making sense of agile modelling