Skip to Main Content
Pro C# 2010 and the .NET 4 Platform, Fifth Edition
book

Pro C# 2010 and the .NET 4 Platform, Fifth Edition

by Andrew Troelsen
May 2010
Intermediate to advanced content levelIntermediate to advanced
1752 pages
41h 17m
English
Apress
Content preview from Pro C# 2010 and the .NET 4 Platform, Fifth Edition

18.5. COM Interop using C# 4.0 Language Features

Assume you have a Windows Form GUI application (named ExportDataToOfficeApp), whose main Form defines a DataGridView named dataGridCars. This same form has two Button controls, one of which will bring up a dialog box to insert a new row of data to the grid, and the other of which needs to export the grid's data to an Excel spreadsheet. Given the fact that the Excel application exposes a programming model via COM, you can hook into this object model using the interoperability layer. Figure 18-9 shows the completed GUI.

Figure 18.9. The GUI of the COM interop example

You will fill the grid with ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner
Visual C++ 2008: How to Program, Second Edition

Visual C++ 2008: How to Program, Second Edition

P. J. Deitel, H. M. Deitel, D. T. Quirk

Publisher Resources

ISBN: 9781430225492Purchase book