LET'S CONNECT!
Enter for a chance to win an eBook of your choice from InformIT. Fill out the form.
Register your product to gain access to bonus material or receive a coupon.
<> The focus of the book is on COM Interoperability (since it's a much larger subject), and the heart of the discussion is broken down into four parts:
The scope of the book is just about everything related to using "unmanaged code" in the .NET Framework. Technologies built on top of COM Interoperability are also covered-Interoperability of Windows Forms Controls and ActiveX controls, Interoperability with COM+, and Interoperability with Distributed COM (DCOM). Although Platform Invocation Services is a separate technology from COM Interoperability, there are many areas of overlap, so including in the book is a natural fit. All of these technologies are a core part of the Common Language Runtime and .NET Framework, and will likely be used not only as the path of migration for existing software projects, but for brand new software development for the next several years.
This product consists of of two volume set.
Responding to COM Events in .NET Applications
The Essentials for Using COM in Managed Code
(NOTE: Each chapter concludes with a Conclusion.)
Introduction.
I. BACKGROUND.
1. Introduction to the .NET Framework.What Is .NET? Features of the .NET Framework. Concepts Important for This Book. Languages and Tools.
2. Bridging the Two Worlds-Managed and Unmanaged Code.Managed Code Versus Unmanaged Code. How Unmanaged Code Interacts with Managed Code. Unmanaged Code Isn't Always the Answer.
II. USING COMCOMPONENTS IN .NETAPPLICATIONS.
3. The Essentials for Using COM in Managed Code.Referencing a COM Component in Visual Studio .NET. Referencing a COM Component Using Only the .NET Framework SDK. Example: A Spoken Hello, World Using the Microsoft Speech API. The Type Library Importer. Using COM Objects in ASP.NET Pages. An Introduction to Interop Marshaling. Common Interactions with COM Objects. Using ActiveX Controls in .NET Applications. Deploying a .NET Application That Uses COM. Example: Using Microsoft Word to Check Spelling.
4. An In-Depth Look at Imported Assemblies.Converting the Library. Converting COM Data Types. Converting Methods and Properties. Converting Interfaces. Converting Classes. Converting Modules. Converting Structures. Converting Unions. Converting Enumerations. Converting Typedefs. Converting ActiveX Controls.
5. Responding to COM Events.Callbacks in .NET. Callbacks in COM. Handling COM Events in Managed Code. Handling ActiveX Control Events in Managed Code.
6. Advanced Topics for Using COM Components.Do-It-Yourself Marshaling. Threading and Apartments. Troubleshooting an InvalidCastException. Garbage Collection. Securing Unmanaged Calls. Using COM+ and DCOM Objects. Inheriting from COM Classes. Debugging into COM Components. Monitoring Performance.
7. Modifying Interop Assemblies.How to Change an Assembly's Contents. IL Assembler Syntax. Changing Data Types. Exposing Success HRESULTs. Arrays. Custom Attributes. Adding Methods to Modules.
III. USING .NETCOMPONENTS IN COMAPPLICATIONS.
8. The Essentials for Using .NET Components from COM.A Sample .NET Component. Using a .NET Component in Visual Basic 6. Using a .NET Component in Unmanaged Visual C++. Using a .NET Component in Unmanaged JScript. Assembly Registration. The Type Library Exporter. .NET Class Interfaces. Interacting with a .NET Object. Deploying a COM Application That Uses .NET. Hosting Windows Forms Controls in Internet Explorer.
9. An In-Depth Look at Exported Type Libraries.Converting the Assembly. Converting .NET Data Types. Converting Members. Converting Interfaces. Converting Classes. Converting Value Types. Converting Enumerations.
10. Advanced Topics for Using .NET Components.Avoiding Registration. Hosting Windows Forms Controls in Any ActiveX Container. Working Around COM-Invisibility. Using Reflection to Invoke Static Members. Handling .NET Events. Unexpected Casing in Type Libraries. Advanced Shutdown Topics.
IV. DESIGNING GREAT .NETCOMPONENTS FOR COMCLIENTS.
11. .NET Design Guidelines for Components Used by COM Clients.Naming Guidelines. Usage Guidelines. Reporting Errors. Exposing Enumerators to COM. Versioning. Deployment. Testing Your Component from COM.
12. Customizing COM's View of .NET Components.Customizing Data Types. Customizing Structure Layout. Exposing Class Interfaces. Using Visual Basic .NET's ComClassAttribute. Making APIs Invisible to COM. Customizing Registration. Providing Your Own GUIDs. Providing Your Own DISPIDs. Controlling Interface Derivation. Returning a Specific HRESULT. Disabling Type Library Marshaling of .NET Interfaces. Creating Multi-Cultured Methods. Using Optional Parameters in Any Language. Exposing .NET Objects As COM+ Objects.
13. Exposing .NETEvents to COM Clients.Exposing Events Without Using Extra CLR Support. Exposing Events Using Extra CLR Support. Example: Handling a .NET Windows Form's Events from COM.
14. Implementing COM Interfaces for Binary Compatibility.Getting Interface Definitions. Binary Compatibility with Visual Basic 6 Classes. Example: Implementing Office XP Smart Tag Interfaces. Interface Implementation Shortcuts in Visual Studio .NET. Common Problems When Implementing COM Interfaces. COM Interfaces with Default CCW Implementations. COM Interfaces Bridged to Different .NET Types.
V. DESIGNING GREAT COMCOMPONENTS FOR .NETCLIENTS.
15. Creating and Deploying Useful Primary Interop Assemblies.Primary Interop Assembly or Brand New Assembly? Creating a Primary Interop Assembly. Deploying and Registering a Primary Interop Assembly. Writing IDL That Produces Good Type Libraries. What About ActiveX Controls?
16. COM Design Guidelines for Components Used by .NET Clients.General Guidelines. Using Array Parameters. Issues with VARIANT Parameters. Reporting Errors. Adjusting Certain COM-Specific Idioms. Managing Limited Resources. Threading and Apartment Guidelines. Providing Self-Describing Type Information. Naming Guidelines. Performance Considerations.
17. Implementing .NET Interfaces for Type Compatibility.Class Interfaces. Interface Inheritance. Considerations for Visual C++ Programmers. Considerations for Visual Basic 6 Programmers.
VI. PLATFORM INVOCATION SERVICES (PINVOKE).
18. The Essentials of PInvoke.Using PInvoke in Visual Basic .NET. Using PInvoke in Other .NET Languages. Choosing the Right Parameter Types. Customizing Declare and DllImportAttribute.
19. Deeper Into PInvoke and Useful Examples.Callbacks. Passing Structures. Handling Variable-Length Structures and Signatures. Using C# Unsafe Code. Guarding Against Premature Garbage Collection. Choosing the DLL Location or Name Dynamically. Example: Responding Immediately to Console Input. Example: Clearing the Console Screen. Example: Using CoCreateInstanceEx to Activate Remote COM Objects.
VII. ADVANCED TOPICS.
20. Custom Marshaling.Transforming Types Without Custom Marshaling. Custom Marshaling Architecture. Marshalers, Marshalers, Marshalers! Limitations.
21. Manually Defining COM Types in Source Code.Using SDK Tools for Support. Manually Defining COM Interfaces. Manually Defining Coclass Interfaces and Event Types. Manually Defining COM Structures. Manually Defining COM Enums. Manually Defining COM Classes. Avoiding the Balloon Effect.
22. Using APIs Instead of SDK Tools.Generating an Assembly from a Type Library. Generating a Type Library from an Assembly. Registering and Unregistering Assemblies. Installing and Uninstalling Serviced Components. Example: Using the APIs in an Interactive Application.
VIII. COMPREHENSIVE EXAMPLES.
23. Writing a .NET Arcade Game Using DirectX.The User's Perspective. The Programmer's Perspective. DirectX Interaction. The Game Class. Sounds and Pictures. Layers. Screens. The Actors. Using the Game Class. E-mail Attack-The Advanced Version.
24. Writing .NET Visualizations For Windows Media Player.The COM Visualization API. Creating a .NET Visualization API. Using the .NET Visualization API.
IX. APPENDICES.
Appendix A. System.Runtime.InteropServices Reference.The System.Runtime.InteropServices Namespace. The System.Runtime.InteropServices.CustomMarshalers Namespace. The System.Runtime.InteropServices.Expando Namespace.
Appendix B. SDK Tools Reference.TLBIMP.EXE. TLBEXP.EXE. REGASM.EXE. AXIMP.EXE. REGSVCS.EXE.
Appendix C. HRESULT to .NET Exception Transformations.GDI32.DLL. KERNEL32.DLL. OLE32.DLL. SHELL32.DLL. USER32.DLL.
Appendix F. Glossary.The errata for the book is available here in Adobe Portable Document Format (PDF) format. You will need Adobe's Acrobat Reader to view these files. If you do not have the Acrobat Reader installed, you may go to Adobe Systems' web site to download this free reader.
Click on the links below to display the PDF file in a new window. Right-click on the link and select Save As if you want to download it to your hard drive.
Errata for the book - 200 kb -- 067232170Xerrata.pdfPearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.
This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.
To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:
For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.
For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.
Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.
Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.
If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.
On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.
We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.
Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.
Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.
This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.
This site currently does not respond to Do Not Track signals.
Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.
This site is not directed to children under the age of 13.
Pearson may send or direct marketing communications to users, provided that
Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.
If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.
Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.
Pearson does not rent or sell personal information in exchange for any payment of money.
While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.
California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.
Pearson may disclose personal information, as follows:
This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.
Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.
We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.
Last Update: November 17, 2020