COM and .NET Interoperability

  Author:    Andrew Troelsen
  ISBN:    1590590112
  Sales Rank:    531071
  Published:    2002-04-20
  Publisher:    Apress
  # Pages:    769
  Binding:    Paperback
  Avg. Rating:    5.0 based on 6 reviews
  Used Offers:    13 from $21.37
  Amazon Price:    $43.76
  (Data above last updated:  2008-10-17 07:49:10 EST)
  
  
Sort customer reviews by:
  
Show All Reviews on Page      Hide All Reviews on Page
   
  
COM and .NET Interoperability
  

COM and .NET Interoperability provides a complete overview of the process of building .NET applications that interact (interoperate) with existing COM code. Before digging into that critical topic, author Andrew Troelsen offers a concise overview of the COM architecture and provides examples using various COM frameworks (C++, ATL, and VB 6.0) as well as the core .NET managed languages (C# and VB .NET).

After covering the preliminaries, the book explores numerous issues that arise in interoperability, including interacting with the Win32 API, dynamically generating source code via System.CodeDOM, creating serviced (COM+) components using managed code, manually editing (and recompiling) .NET metadata, and the process of constructing custom COM/.NET conversion utilities. Both intermediate and advanced developers will welcome the practical information they need to quickly work with COM and COM+ in .NET applications, and learn how to create .NET components that are COM compatible.

Aimed at the more experienced developer who needs to get the old and the new in Windows to coexist, COM and .NET Interoperability gives you all the nitty-gritty detail to get .NET Framework code and the older COM standard to work together effectively. Crammed with technical knowledge and a wide range of programming techniques you most likely won't find anywhere else, this book will fill a worthwhile niche as corporations move older Windows code to .NET.

The in-depth technical detail of the inner workings of both COM and .NET sets it apart. It says a lot about this title that it is only after 300 pages of introductory material on the inner workings of COM and .NET that the text turns to interoperability between the two. First comes a traditional tour of COM components, including all the gnarly details of Iunknown, GUIDs, type libraries, late binding (and Idispatch), and deployment through the registry. A short section looks at using the Active Template Library (ATL) and its wizards to simplify "traditional" COM components.

The author also examines how to build and deploy equivalent components in .NET, along with some more advanced material on reflection, generating on-the-fly code, and assembly information. Material on emulating late-binding in .NET is also a standout here, as this technique is not obvious under the new Windows.

At the heart of this book are six chapters showing how to get .NET to call COM code and vice versa, organized into beginning, intermediate, and advanced techniques for each. Core material here shows how to invoke COM objects within .NET, as well as ActiveX controls, a worthy addition, as this is likely to be a workable strategy for .NET developers for years to come. Advanced techniques range further afield. When it comes to calling .NET code from older COM code, apart from the basics of invoking .NET from within "traditional" C++ and Visual Basic, the author also shows how to "consume" new .NET classes like collections within COM.

Final sections turn toward other COM+ services, with a full tour of transactions and just-in-time activation (JITA) for building more scalable Windows components. (Here, besides "classic" COM+ components in C++, the author shows how to do it in .NET.) The book rounds out with examples of "fully serviced" Windows components in .NET, including a solid example using a Web service.

While COM is destined to wither away, for the next few years there will be ample opportunity for advanced programmers to leverage an in-depth knowledge of COM and .NET. This book's authoritative treatment of most every conceivable permutation of COM and .NET code interaction makes it the definitive resource on the subject. Armed with this title, any advanced C++/C# developer will be able to mix in old code and new code effectively. --Richard Dragan

Topics covered: Introduction to Platform Invocation (PInvoke) services; calling a traditional DLL from C and C++; using PInvoke to call a traditional DLL with .NET; callback functions in .NET for DLLs; tutorial for COM servers (conventions and built-in interfaces, GUIDs, class factories, deployment); C++ COM clients; IDispatch and scriptable objects; Active Template Library (ATL) basics (including wizard support); COM servers in VB 6; COM IDL files in detail (type libraries and programming reading type info); using C# to view COM type libraries; .NET servers (including assemblies and deployment options); advanced techniques for on-the-fly code generation with the System.CodeDOM APIs; .NET types explained; using .NET reflection APIs (viewing type info in C#); late binding in .NET; basic .NET to COM interoperability (converting COM IDL to .NET types); deploying Interop assemblies; intermediate techniques (including using COM Variants, Param arrays, structures and collections between platforms, events and delegates, error handling); advanced techniques (COM classes implementing .NET interfaces); consuming ActiveX controls in .NET code; modifying Interop assemblies; basic COM to .NET code-sharing techniques (including the COM Callable Wrapper, CCW, the tlbexp.exe utility, COM-aware .NET types); consuming .NET components in VB 6, C++, and VBScript; intermediate COM to .NET techniques (using .NET enumerated types, structures, delegates, and collections within COM); advanced techniques for using .NET in COM (changing type marshaling, custom COM interfaces, defining COM interfaces using managed code, manually defining COM atoms in C#, custom hosts for the .NET runtime); overview of COM+ (including the transactions, pooling, and the COM+ Catalog); classic COM+ components versus .NET equivalentsp; lazy automatic registration; object construction strings; just-in-time activation (JITA); transactional programming in .NET; and sample serviced components (including a Web service example).

COM and .NET Interoperability provides a complete overview on the process of building .NET applications which interact (interoperate) with existing COM code. Before digging into that critical topic, Andrew offers a concise overview of the COM architecture, and provides examples using various COM frameworks (C++, ATL, and VB 6.0). Next, the reader will learn the core aspects of the .NET platform and come to understand the use of both C# and VB .NET during the process. With these primers aside, the remainder of the book covers numerous interoperability issues including interacting with the Windows API, event programming and the process of building custom code conversion utilities.

  • Educates readers on the building blocks of the COM and .NET architectures
  • Covers the internal aspects of COM /.NET interoperability with minimal focus on integrated Wizard tools
  • Readers learn to build custom COM /.NET conversion tools
  • Covers accessing COM components, Win32 API, and C DLLs from .NET applications
  • Covers COM components accessing .NET types

                  Reader Reviews 1 - 7 of 7                 
  
  
Review
Date
Review
Rating(5 High)
Review
Helpful
to:
Customer Review Reviewer
Info
Permanent
Link
Reader Reviews Below Sorted by Newest First
12-22-04 4 2\2
(Hide Review...)  From COM to .NET and Back Again
Reviewer Permalink
There may be times when you need to access legacy COM DLL's written in non-managed C++ or Visual Basic. This may be as a stop-gap measure until your older legacy code can be updated to .NET. In cases where performance is critical, you may have no desire to ever upgrade your C++ DLL, but would like to use C# for GUI design, rather than Microsoft Foundation Classes. If any of these situations apply, this is the book for you.

This book begins with a few chapters that will bring the reader up to date on both sides of the GAP. First you are shown the fundamentals of COM objects. Second you are shown the newer .NET architecture. Only by understanding both sides will you be able to make the two effectively communicate. For experienced users, who are already familiar with COM and .NET this section can easily be skipped. The book then continues with an overview of what datatypes are available on each side, and how they cross over.

The real meat of the book comes in the next two sections. Three chapters (the basics, intermediate and advanced topics) are given first for COM to .NET. Then the exact same pattern is repeated from .NET to COM. I spent most of my time with the .NET to COM part of the book, as I was using a C++ DLL with C#. The book answered all of my questions and I was able to successfully implement the application.

The book provides a great deal of good information, but it is sometimes hard to find exactly what you are looking for. Each direction is covered in chapters named the basics, intermediate and advanced topics. What exactly is meant by this is not clear until you begin the chapter. I often found myself skimming all three sections trying to find an example close to what I was doing.
(Review Data Last Updated: 2007-04-27 20:08:56 EST)
12-21-04 4 2\2
(Hide Review...)  From COM to .NET and Back Again
Reviewer Permalink
There may be times when you need to access legacy COM DLL's written in non-managed C++ or Visual Basic. This may be as a stop-gap measure until your older legacy code can be updated to .NET. In cases where performance is critical, you may have no desire to ever upgrade your C++ DLL, but would like to use C# for GUI design, rather than Microsoft Foundation Classes. If any of these situations apply, this is the book for you.

This book begins with a few chapters that will bring the reader up to date on both sides of the GAP. First you are shown the fundamentals of COM objects. Second you are shown the newer .NET architecture. Only by understanding both sides will you be able to make the two effectively communicate. For experienced users, who are already familiar with COM and .NET this section can easily be skipped. The book then continues with an overview of what datatypes are available on each side, and how they cross over.

The real meat of the book comes in the next two sections. Three chapters (the basics, intermediate and advanced topics) are given first for COM to .NET. Then the exact same pattern is repeated from .NET to COM. I spent most of my time with the .NET to COM part of the book, as I was using a C++ DLL with C#. The book answered all of my questions and I was able to successfully implement the application.

The book provides a great deal of good information, but it is sometimes hard to find exactly what you are looking for. Each direction is covered in chapters named the basics, intermediate and advanced topics. What exactly is meant by this is not clear until you begin the chapter. I often found myself skimming all three sections trying to find an example close to what I was doing.
(Review Data Last Updated: 2007-03-08 17:09:39 EST)
04-14-04 3 2\3
(Hide Review...)  Programmer traps missing
Reviewer Permalink
This book is definitely a good starting point. It covers most of the topics, a newcomer would like to see and enables both, the .NET programmer and the COM programmer (which is most likely a VB programmer) to find a way into the material.
What is missing from my point of view is a section which describes the problems that a typical user/writer of legacy code (which COM definitely is from Microsoft's perspective) will have to overcome before he can reuse COM components in the .NET framework and write COM-usable components within .NET.
Here it relies a bit to much on Microsoft's perspective, which is that "the Framework" will do everything for you.
This is however only partly true and many programmers have gone through hard times.
When you start with COM interop, it all seems to easy... but be assured, Microsoft has a lot of work to do for programmers to make it work seamlessly.
(Review Data Last Updated: 2006-07-06 09:30:52 EST)
02-13-04 5 1\1
(Hide Review...)  Andrew Troelsen 's another master piece...
Reviewer Permalink
The very first book of his I bought about three years ago was COM and ATL3.0. The thing I liked about that book was the way the author explained the difficult concepts of ATL and COM in plain english.

He does it again with this book. The book covers all the aspects of Interop services with examples, and explanations are clear and to the point. I was looking for a book that will help me get started on Interop services quickly and this book helped me tremendously.

Great Job Andrew...

(Review Data Last Updated: 2006-07-06 09:30:52 EST)
08-27-02 5 6\24
(Hide Review...)  YOUR COM IN THE .NET WORLD
Reviewer Permalink
FIRST,LET'S SAY THAT MR.ANDREW DO A GREAT JOB IN HIS BOOKS,DO YOU IMAGINE HOW MUCH MONEY HE SAVE IT FOR YOU WHEN YOU READ HIS BOOKS ?
THE BOOK BEGIN WITH OVERVIEW ABOUT COM AND .NET TOO AND IT'S EASY TO UNDERSTAND TOO,THE BSET THING IN HIS BOOKS THE CHRYSTAL EXAMPLES TO EXPLAIN WHAT HE WANT TO SAY,
MR.ANDREW IS THE BEST AUTHOR IN THE WORLD AND A LOT OF MY FRIENDS SAY THAT TOO BECAUSE HE KNOW WELL WHAT HE'S DOING,
(Review Data Last Updated: 2006-07-06 09:30:52 EST)
08-23-02 5 9\18
(Hide Review...)  WHAT IF YOU ARE NEW TO .NET WORLD
Reviewer Permalink
most of the books about Interoperability bettwen COM and .NET for the programmer who worked with COM for a long time,but what will happen if you are learning .NET now and you don't know anything about COM (because you are new to programming world),so this book (the only one in the market) for the new developers and for expert developers too,it's easy to understand as all Mr.Andrew books,for me if they sell the book for 200 $ i will buy it,because of the way of explainning the subjects,if you want something about COM and .NET and how they work together FOR YOU without pain then go to the nearest bookshop and get this book now.
(Review Data Last Updated: 2006-07-06 09:30:52 EST)
07-23-02 5 10\12
(Hide Review...)  A Must Read for Anyone doing Interop Programming
Reviewer Permalink
Like Andrew's "C# and the .NET Platform", this book combines an excellent technical overview with nitty gritty examples that detail how to use these technologies in your own development. We followed the book's step-by-step instructions to create a CCW that allows us to use the NET framework's XML digital signature support in our existing unmanaged code. Try cobbling up an XMLDSIG implementation on your own! I can't imagine anyone attempting to use Interop technology without a reference like this.
(Review Data Last Updated: 2006-07-06 09:30:52 EST)
  
                  Reader Reviews 1 - 7 of 7                 
  
  
  
  
  
  

Because the data used to generate this site come from outside sources, VeryWellSaid.com cannot guarantee the completeness or accuracy of the data.
Search VeryWellSaid™
Google
Web VeryWellSaid™
New subjects are added every week.
View Subjects Below by:
* Top Selling
 (click category name, left)
* Top-Rated Top Sellers
 (click 'Top Rated', right)
In the news...  
Dubai\UAE Top Rated
Influenza\Bird Flu Top Rated
Iraq Top Rated
Supreme Court Top Rated
All Books Top Rated
Arts Top Rated
Photography Top Rated
Digital Photography Top Rated
Digital Cameras Top Rated
Biography Top Rated
Business Top Rated
Management Top Rated
Marketing Top Rated
Sales Top Rated
Stocks Top Rated
Bonds Top Rated
Real Estate Top Rated
Trading Top Rated
Commodities Trading Top Rated
Time Management Top Rated
Starting A Business Top Rated
Children's Top Rated
Comics Top Rated
Computers Top Rated
PC Top Rated
Mac Top Rated
Programming Top Rated
Design Patterns Top Rated
.Net Top Rated
C# Top Rated
Vb.Net Top Rated
Asp.Net Top Rated
Java Top Rated
Python Top Rated
PHP Top Rated
Perl Top Rated
Javascript Top Rated
Ajax Top Rated
CSS Top Rated
Open Source Top Rated
SQL Top Rated
Databases Top Rated
Oracle Top Rated
MySql Top Rated
Sql Server Top Rated
IIS Top Rated
Apache Top Rated
Linux Top Rated
Windows Server Top Rated
Project Management Top Rated
HTML Top Rated
UML Top Rated
IT Certifications Top Rated
Cisco Certifications Top Rated
MCSE Top Rated
MCSD Top Rated
Cooking Top Rated
Italian Cooking Top Rated
Vegetarian Cooking Top Rated
Wine Top Rated
Engineering Top Rated
Entertainment Top Rated
Health Top Rated
Nutrition Top Rated
Dieting Top Rated
Sex Top Rated
History Top Rated
Military History Top Rated
British History Top Rated
Middle East History Top Rated
Land Battles Top Rated
Naval Warfare Top Rated
Air Warfare Top Rated
9/11 Top Rated
Terrorism Top Rated
Home Top Rated
Mortgage\Home Equity Loan Top Rated
Cars Top Rated
Car Buying Top Rated
Sports Cars Top Rated
Cat Top Rated
Humor Top Rated
Horror Top Rated
Law Top Rated
IP Law Top Rated
Legal History Top Rated
Fiction Top Rated
Oprah's Book Club Top Rated
Medicine Top Rated
Cancer Top Rated
Stroke Top Rated
Heart Disease Top Rated
Fertility Top Rated
Diabetes Top Rated
Pharmacology Top Rated
Back Problems Top Rated
Menopause Top Rated
Thyroid Top Rated
Pain Top Rated
Organic Chemistry Top Rated
Immune System Top Rated
Mystery Top Rated
Nonfiction Top Rated
Outdoors Top Rated
Running Top Rated
Radio Control Models Top Rated
Guns Top Rated
Parenting Top Rated
Divorce Top Rated
Professional Top Rated
Reference Top Rated
Religion Top Rated
Romance Top Rated
Science Top Rated
Physics Top Rated
Chemistry Top Rated
Astronomy Top Rated
Psychology Top Rated
Science Fiction Top Rated
Sports Top Rated
Teens Top Rated
Travel Top Rated
USA Top Rated
Europe Top Rated
France Top Rated
Italy Top Rated
England Top Rated
China Top Rated
All Books Arts Biography Click Here For An A-Z Index Of All 213 Best-Seller Subjects Business Children's Comics
Computers Cooking Engineering Entertainment Health History Home Horror Humor Law Fiction Medicine Mystery
Nonfiction Outdoors Parenting Professional Reference Religion Romance Science Sci-Fi Sports Teens Travel
In Association with Amazon.com

Cache miss
(not cached)