Friday, August 20, 2010
Visual C++.Net Web Developer Guide
Unless you’ve been hiding in a cave in a remote part of the earth, Microsoft has inundated
you with news of .NET by now. Microsoft’s marketing machine is working overtime, as usual,
to ensure you don’t miss their latest and greatest product. If you listen to the Microsoft hype,
it seems that they expect everyone to drop billions (trillions?) of lines of code and adopt
.NET tomorrow. What the hype doesn’t mention is that adopting .NET completely means
starting from scratch.
The real world is a different place than the fantasyland of Microsoft hype. In the real world,
developers have to maintain existing code at the lowest possible cost and still produce new
applications in record time. The task seems impossible when you have two completely
different technologies to develop these applications. On the one hand, you have the realm of
MFC and the Win32 API. On the other hand, you have the new .NET Framework. Which do
you choose for a given task?
Answering the question of which technology to use is one of the biggest problems this book
will tackle. We’ll discuss how to use the old, the new, and, most impotantly, the mixed
environments of Visual C++ .NET. Knowing when .NET can actually help you create an
application faster is the key to managing application development in an environment where
you have two different architectures to consider.
Microsoft’s .NET Framework is an exciting new technology for a developer looking for every
productivity enhancement available. My purpose in writing this book is to help you balance
the usefulness of this new technology against the need to maintain existing code. By the
time you complete this book, you’ll not only know how to work with .NET to create some
relatively complex applications, but you’ll better understand when .NET is a good choice for
What’s in This Book
Visual C++ .NET Developer’s Guide contains a mix of theory and programming examples,
with a heavy emphasis on the programming examples. You’ll find a mix of Win32, MFC,
ATL, and .NET code within the book. In some cases, I’ll show you how to mix an existing
technology with a new one—Visual C++ .NET is definitely a transitional language, one that
will help you move from Win32 application development to .NET. Here’s a brief overview of
the six parts of this book.
Part I—Visual C++ in General
This part of the book introduces you to some of the new features in Visual C++ .NET. We’ll
also discuss some basic programming principles. You’ll learn how to create various types of
applications. Most of the code in this part is unmanaged. However, this part includes some
managed code examples that show how you’d create the same result as an unmanaged
counterpart using the .NET Framework.
You’ll also learn some advanced coding processes in this part of the book. We’ll discuss
threads in Chapter 3, and I’ll show you how to create two types of threads. The graphics
programming examples in Chapter 4 include both static graphics and animated graphics
using GIFs. Chapter 5 will help you understand the intricacies of Active Directory, while
Chapter 6 shows how to create components using both ATL and MFC.
Part II—Visual C++ .NET and Database Management
Database management is an essential part of every business today. Chapter 7 of this part
tells you about the various technologies and indicates when you can best use them to your
advantage. We also look at how to create and use DSNs.
Chapter 8 is the unmanaged coding example for this part. You’ll learn how to use OLE-DB to
create a basic database application that includes a form view, printing, and search routines.
This section of the book also tells you how to get around certain problems with the Visual
C++ .NET environment. For example, Visual C++ .NET doesn’t ship with all of the controls
found in Visual Studio 6. Some of your applications might require these controls, so I show
how to install them. Unfortunately, some controls won’t work even if you do install them, and
I show you how to get around some of these problem areas.
Chapter 9 is the managed coding example for this part. We discuss ODBC .NET in this
chapter. Unfortunately, ODBC .NET wasn’t ready in time for the book, so you won’t see a
coding example. We’ll create a managed example using ADO .NET that includes use of the
new DataGrid control (among others). This section also shows how to create a print routine
and other database application basics.
Part III—Visual C++ and Online Computing
Distributed applications are becoming more prominent as businesses move to the Internet in
an effort to remain connected with partners, employees, and customers. This part of the
book shows you how to work with SOAP and discusses Web Services in general. You’ll also
learn how to work with alternative devices such as PDAs. Chapter 10 contains a simple
ASP.NET example that helps you understand the benefits of this technology. Chapter 11
shows you how to create both ISAPI Filters and ISAPI Extensions as well as a SOAP
application that relies on the Microsoft SOAP Toolkit. Most of the examples in this part of the
book rely on unmanaged programming techniques.
Part IV—Visual C++ .NET and Microsoft.NET
Most of the examples in this part of the book rely on managed programming techniques.
You’ll learn how to create various types of managed applications that rely exclusively on the
.NET Framework. Chapter 12 is unique because it compares Visual C++ .NET to C# and
even provides an example in both languages for comparison purposes. This is also the
chapter to read if you want to learn how to move your applications to .NET. Chapter 13 is
your key for learning about the new attributed programming techniques provided with Visual
C++ .NET. Attributes greatly reduce the coding burden for the developer. Examples in this
chapter use both managed and unmanaged coding techniques. Chapter 14 shows you how
to work with managed components. You’ll also create a custom attribute and use reflection
to read its contents from the compiled application.
Part V—The Developer View of Visual C++ .NET
This part of the book contains a mix of topics that didn’t fit well anywhere else, but are
extremely imprtant for the developer. Chapter 15 discusses the inner workings of Security
within Windows 2000 and Windows XP. Security is an imprtant topic in a world where
crackers make it their business to test your applications for holes in every way possible.
Chapter 16 shows how to create administration tools for your applications. Most complex
applications require some type of configuration and “tweaking” as part of the installation and
maintenance cycle. Using the Microsoft Management Console (MMC) to maintain your
application makes sense because it reduces the user interface design burden for the
developer and reduces the amount of code required to create the management program.
Chapter 17 shows you how to create various types of help files. Microsoft is always moving
on to some new form of help, but sometimes you need to use the older forms of the help file
as well. This chapter shows how to create both. Finally, Chapter 18 shows how to package
your application once you finish building it.
Part VI—Appendixes and Glossary
This last part of the book contains two appendixes and a glossary. Appendix A tells you how
to get the best deal for your next component purchase. It also helps you find some “must
have” components for your next application. Appendix B is an online resource guide that
helps you locate additional information about Visual C++ .NET. Sometimes it’s good to know
where to find additional help. Finally, the Glossary contains a complete list of every esoteric
term and acronym used in the book.
Aanother .NET books
Another C++ Books