Extending MFC Applications with the .Net Framework

( 1 )

Overview

Extending MFC Applications with the .NET Framework is the first book to show MFC developers how to boost productivity by incorporating .NET functionality into existing MFC applications. Tom Archer clearly illustrates how using the .NET Base Class Library (BCL) -- to complement or replace MFC classes when there is a clear advantage -- enables MFC developers to create elegant and robust Windows applications in the most efficient way possible. Each chapter begins with an introduction that explains the technology, ...
See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (4) from $48.61   
  • New (2) from $48.61   
  • Used (2) from $90.22   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$48.61
Seller since 2013

Feedback rating:

(24)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
Programming & scripting languages: general

Ships from: Amman, Jordan

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$65.00
Seller since 2006

Feedback rating:

(316)

Condition: New
Boston, MA 2003 Trade paperback New. BRAND NEW. Audience: General/trade.

Ships from: Chicago, IL

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

Extending MFC Applications with the .NET Framework is the first book to show MFC developers how to boost productivity by incorporating .NET functionality into existing MFC applications. Tom Archer clearly illustrates how using the .NET Base Class Library (BCL) -- to complement or replace MFC classes when there is a clear advantage -- enables MFC developers to create elegant and robust Windows applications in the most efficient way possible. Each chapter begins with an introduction that explains the technology, outlines its benefits, lists its pragmatic business uses, and summarizes the required syntax. As is an Archer trademark, this information is solidified with hands-on, practical demo applications. The CD-ROM supplies the complete downloadable source code, working samples, and test code from the book, as well as several productivity-enhancing utilities such as a Visual Studio .NET Custom AppWizard.
Read More Show Less

Product Details

  • ISBN-13: 9780321173522
  • Publisher: Pearson Education
  • Publication date: 10/24/2003
  • Pages: 656
  • Product dimensions: 6.84 (w) x 9.48 (h) x 0.93 (d)

Table of Contents

Foreword
Preface
Acknowledgments
Ch. 1 Combining MFC and Managed Extensions 1
Ch. 2 Regular Expressions 45
Ch. 3 File I/O and Registry 95
Ch. 4 Cryptography, Hash Codes, and Data Encryption 157
Ch. 5 XML and the DOM 223
Ch. 6 Disconnected Data via ADO.NET and DataSets 285
Ch. 7 Advanced ADO.NET 361
Ch. 8 Combining ADO.NET and XML 417
Ch. 9 Remoting 449
Ch. 10 Event Log, Process Control, and Benchmarking 487
Ch. 11 Managing Your Managed Objects 539
App. A XML Overview and Syntax 589
App. B XPath Overview and Syntax 595
Index 599
Read More Show Less

Preface

Book's Assumptions and Goals

This book assumes that you are an experienced MFC developer who, while not ready to completely migrate your code to .NET, is interested in seeing how .NET can make you more productive. As an MFC developer, you're infinitely more comfortable with the document/view and dialog model of creating user interfaces and are simply much more productive with this development environment. In addition, you might have a large amount of source code that you're not willing or able to migrate to .NET right now—if ever. However, you're still intrigued by some of the .NET classes and how they might compliment or even replace various MFC counterpart classes. That is specifically who this book targets. As opposed to the many .NET books that seem to take the attitude that it will be all or nothing for developers, this book is more realistic in realizing that many developers (especially those using C++ and MFC) will want to use .NET only where there is a clear and obvious advantage.

One important point to make here is that this book is not a “Managed Extensions” book in the truest sense. In addition, while I do go into some detail on the various .NET classes that I illustrate throughout this book, this book is not a “.NET class library book.” There are hundreds of .NET types and classes and that simply isn't the focus here. My objective is to show you a select few classes that I feel would benefit most MFC developers. An example of that would be the XML chapter.

XML has become the standard for exchanging data in many organizations. However, in order to use XML from MFC, you're probably going to be using the Microsoft IE (InternetExplorer) XMLDOM via COM. While this is workable solution—I've written several articles and book chapters on how this is done—using the XMLDOM just doesn't compare to the very elegant and powerful set of .NET XML classes. Therefore, a complete chapter is devoted to the .NET XML namespace—covering everything from reading/writing XML files and traversing XML documents to querying XML data using XPath and making XSL transformations—all from an MFC application!

As a result of this approach, when finished with this book, you will know how to use IJW in order to enhance your existing—and future—MFC applications with the .NET classes that interest you most; thereby making you a more productive—and marketable—programmer.

Technical Preface

Before getting started, let's clear up some definitions as that will dovetail nicely into the goals and organization of this book. While it's sometimes helpful to think of Visual C++.NET as containing two separate C++ compilers—one for managed (.NET) code and one for unmanaged code—technically, the Visual C++.NET product contains only one compiler that has two distinct parts:

  • Sum ISO Standard C++: This ISO-compliant C++ compiler can be used (with the inclusion of the appropriate libraries) to generate native (x86) executables and libraries for projects such as console applications, Windows applications, Windows services and so on. When combined with the MFC class library, this is what pays the bills for most of the intended readers of this book (and its authors).
  • Sum Managed Extensions: These refer to the language constructs available for mixing managed C++ syntax with your standard C++ code. The managed extensions allow you to define and use managed types (garbage collected reference type, value types, scoped enums, delegates, etc.), and use managed runtime facilities such as reflection and security.
Therefore, there's only one compiler and you can think of managed extension as somewhat like other Microsoft C/C++ extensions—like __declspec—except obviously more extensive as it has the responsibility of exposing all of the CLI features: garbage collection, reflection, etc, You might even think of managed extensions as a superset language containing Standard C++ as a subset. So now I know that a single compiler can generate both native and managed code for Standard C++. What about mixed code applications? Let's look at two techniques for mixing native and managed C++ code: COM Interop and IJW.

There are actually two types of COM Interop. There is the COM Callable Wrapper (CCW) that allows you to create a “pure” native application (with no .NET build-time dependencies) that accesses .NET code via COM and the Runtime Callable Wrapper (RCW) that allows you to access native code from managed applications. Therefore, one direction I could have taken in this book would have been to write MFC applications and then access the various selected .NET classes via CCW. However, CCW has many drawbacks that inevitably make it unappealing. First, CCW is not very efficient in terms of execution speed. Second, CCW cannot use the entire CLR type system—method parameters and properties are restricted to automation types. Finally, many .NET types are not exposed to COM so accessing them would be very difficult to impossible.

So what about IJW? IJW—which stands for It Just Works—refers to the collection of mechanisms that allow managed code to call native functions, compile unmanaged types in MSIL, use unmanaged types in managed type method signatures, provide native entry points to MSIL methods, etc. However, IJW is not only about managed code calling native functions. It's also about exposing native entry points to managed functions and basically doing all the plumbing necessary to get C++ code to work under .NET.

If you're a bit confused by the last paragraph, that's perfectly understandable. After all, it now sounds like I'm talking about writing .NET applications that use native code when the book's topic promises to be about the opposite—using .NET to augment MFC applications! As it turns out, while at first blush, this does seem to be backwards and the designers of IJW probably intended it for .NET applications that need to occasionally call a native function, it turns out that it works just fine for a .NET application that is 90 percent native. As a result, since IJW has full access to the .NET class hierarchy and type system and is much more efficient than CCW, this is the technique used throughout the book.

Read More Show Less

Introduction

Book's Assumptions and Goals

This book assumes that you are an experienced MFC developer who, while not ready to completely migrate your code to .NET, is interested in seeing how .NET can make you more productive. As an MFC developer, you're infinitely more comfortable with the document/view and dialog model of creating user interfaces and are simply much more productive with this development environment. In addition, you might have a large amount of source code that you're not willing or able to migrate to .NET right now—if ever. However, you're still intrigued by some of the .NET classes and how they might compliment or even replace various MFC counterpart classes. That is specifically who this book targets. As opposed to the many .NET books that seem to take the attitude that it will be all or nothing for developers, this book is more realistic in realizing that many developers (especially those using C++ and MFC) will want to use .NET only where there is a clear and obvious advantage.

One important point to make here is that this book is not a "Managed Extensions" book in the truest sense. In addition, while I do go into some detail on the various .NET classes that I illustrate throughout this book, this book is not a ".NET class library book." There are hundreds of .NET types and classes and that simply isn't the focus here. My objective is to show you a select few classes that I feel would benefit most MFC developers. An example of that would be the XML chapter.

XML has become the standard for exchanging data in many organizations. However, in order to use XML from MFC, you're probably going to be using the Microsoft IE (Internet Explorer) XMLDOM via COM.While this is workable solution—I've written several articles and book chapters on how this is done—using the XMLDOM just doesn't compare to the very elegant and powerful set of .NET XML classes. Therefore, a complete chapter is devoted to the .NET XML namespace—covering everything from reading/writing XML files and traversing XML documents to querying XML data using XPath and making XSL transformations—all from an MFC application!

As a result of this approach, when finished with this book, you will know how to use IJW in order to enhance your existing—and future—MFC applications with the .NET classes that interest you most; thereby making you a more productive—and marketable—programmer.

Technical Preface

Before getting started, let's clear up some definitions as that will dovetail nicely into the goals and organization of this book. While it's sometimes helpful to think of Visual C++.NET as containing two separate C++ compilers—one for managed (.NET) code and one for unmanaged code—technically, the Visual C++.NET product contains only one compiler that has two distinct parts:

  • Sum ISO Standard C++: This ISO-compliant C++ compiler can be used (with the inclusion of the appropriate libraries) to generate native (x86) executables and libraries for projects such as console applications, Windows applications, Windows services and so on. When combined with the MFC class library, this is what pays the bills for most of the intended readers of this book (and its authors).
  • Sum Managed Extensions: These refer to the language constructs available for mixing managed C++ syntax with your standard C++ code. The managed extensions allow you to define and use managed types (garbage collected reference type, value types, scoped enums, delegates, etc.), and use managed runtime facilities such as reflection and security.
Therefore, there's only one compiler and you can think of managed extension as somewhat like other Microsoft C/C++ extensions—like __declspec—except obviously more extensive as it has the responsibility of exposing all of the CLI features: garbage collection, reflection, etc, You might even think of managed extensions as a superset language containing Standard C++ as a subset. So now I know that a single compiler can generate both native and managed code for Standard C++. What about mixed code applications? Let's look at two techniques for mixing native and managed C++ code: COM Interop and IJW.

There are actually two types of COM Interop. There is the COM Callable Wrapper (CCW) that allows you to create a "pure" native application (with no .NET build-time dependencies) that accesses .NET code via COM and the Runtime Callable Wrapper (RCW) that allows you to access native code from managed applications. Therefore, one direction I could have taken in this book would have been to write MFC applications and then access the various selected .NET classes via CCW. However, CCW has many drawbacks that inevitably make it unappealing. First, CCW is not very efficient in terms of execution speed. Second, CCW cannot use the entire CLR type system—method parameters and properties are restricted to automation types. Finally, many .NET types are not exposed to COM so accessing them would be very difficult to impossible.

So what about IJW? IJW—which stands for It Just Works—refers to the collection of mechanisms that allow managed code to call native functions, compile unmanaged types in MSIL, use unmanaged types in managed type method signatures, provide native entry points to MSIL methods, etc. However, IJW is not only about managed code calling native functions. It's also about exposing native entry points to managed functions and basically doing all the plumbing necessary to get C++ code to work under .NET.

If you're a bit confused by the last paragraph, that's perfectly understandable. After all, it now sounds like I'm talking about writing .NET applications that use native code when the book's topic promises to be about the opposite—using .NET to augment MFC applications! As it turns out, while at first blush, this does seem to be backwards and the designers of IJW probably intended it for .NET applications that need to occasionally call a native function, it turns out that it works just fine for a .NET application that is 90 percent native. As a result, since IJW has full access to the .NET class hierarchy and type system and is much more efficient than CCW, this is the technique used throughout the book.

Read More Show Less

Customer Reviews

Average Rating 4
( 1 )
Rating Distribution

5 Star

(0)

4 Star

(1)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Review
  • Anonymous

    Posted February 8, 2004

    Use XML and cryptography under .NET

    There is a vast group of Visual C++ coders out there, you perhaps amongst them. Successfully writing and maintaining what is perhaps now large source code bodies. In doing so, you've become quite experienced and you know the ins and outs of Visual C++. But about 2 years ago, Microsoft starting pushing a wonderful new .NET platform. Impressive claims about how one could develop code in several languages sitting atop this. Technically nice. But for you, much of this was moot. You and others in your group have no inclination to start coding in Pascal, anyway. You cannot abandon Visual C++. So the authors wrote this book, targeted towards you. It is not a comprehensive introduction to .NET. But they chose to focus on a few topics that you might value. XML for example. This is now a widely adopted standard for data interchange, and if your code isn't already familiar with it, then it might be a good thing to add. It motivates you to start dipping into .NET. Plus, in order to parse XML, they show how to use the standard Document Object Model (DOM) parser that is available under .NET. All useful stuff. They also use cryptography as another hook into .NET. It is just a guess, but some of your applications might need this. So here is how to use some of the latest advanced implementations of hashing and public key infrastructure. And if these are done in .NET, well, gosh, what a coincidence. :)

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Review

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)