×

Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Professional Visual C++ Activex COM Control Programming
     

Professional Visual C++ Activex COM Control Programming

by Sing Li, Panos Economopoulos
 
Long Live the Information Superhighway!
Wait a minute! I heard some loud heckling from the back row.
"I thought this is a 'Microsoft ActiveX' technical programming book?!"
It is.
The point is, there are two ways you can show a technology: either in dry, boring isolation, talking about the nuances without reference to the problems the technology

Overview

Long Live the Information Superhighway!
Wait a minute! I heard some loud heckling from the back row.
"I thought this is a 'Microsoft ActiveX' technical programming book?!"
It is.
The point is, there are two ways you can show a technology: either in dry, boring isolation, talking about the nuances without reference to the problems the technology is supposed to solve, or as we've attempted to do, applying the technology to a real-world situation. We've chosen to show you ActiveX programming by applying this technology to a large growth area, intranets. As you'll soon see, the ActiveX family of technologies is a very broad family covering the gamut of Internet-intranet, client-server and distributing computing solutions. It has to be this way, since ActiveX represents Microsoft's entire investment into the Internet-intranet (and object based distributed computing) race. Within this book, ActiveX will be used as a vehicle to explore many of the concepts and techniques involved in intranet construction. In many cases, the concepts and approaches explored are generally applicable to your practice whether it's Microsoft-, UNIX-, or even Netscape-centric. What's Covered in this Book Just before the technical reader, fluent with Visual C++, decides to return this book to the bookstore for a refund, I must say that this is by no means a 'lame theoretical treatise'. We turn on the power-throttle, and shine our high beams on the core ActiveX technologies once we've reached Chapter 2. In fact, a discussion of what intranets are about has been relegated to Appendix A, simply because you don't actually need to know about them to gain an understanding of ActiveX. From there we dive into the depths of the Microsoft's Component Object Model (COM) which is fundamental to all of Microsoft's ActiveX technology. Covering the basics, we'll be taking a view that reduces this complex topic to simple programming practices that we're fully familiar with. From there, we examine the concept of COM aggregation and show how it further enhances code reuse and provides a powerful mechanism for COM. In Chapter 3, we take our understanding of COM and put it into practice by writing an ActiveX control from scratch, using just raw C++. Here, we'll become intimate with the complete anatomy of a simple ActiveX control. When we move on to more powerful libraries and code generation wizards, this basic understanding will enable us to adapt and troubleshoot more effectively. In this chapter, we encounter many essential COM interfaces through actual hands-on programming; we'll also get acquainted with some indispensable COM programming tools such as the MIDL compiler and the Object Viewer utility. To handle some more complex problems without coding forever, we'll take a look at programming libraries to simplify the COM object programming task (ActiveX controls, to be precise). We'll explore how to code powerful, yet super efficient and tiny COM objects using the ActiveX Template Library (ATL) 2.1, and we will spend some time explaining many of the new COM interfaces, and show how ATL makes everything simple. Also in this chapter, we'll be learning about the threading models supported by COM objects and the different types of COM servers that can be created. Using ATL to create ActiveX controls is the focus of Chapter 4. Chapters 2, 3 and 4 give us enough background into understanding what ActiveX provides for the intranet development environment. We'll understand how ActiveX controls can be fundamental building blocks (actually software components) in both client- and server-based programming. We'll make excursions into the ActiveX controls (OCX ) specifications in Chapter 5, covering the differences between the OLE Control specification (for Visual controls) and the new OC96 specification (for ActiveX controls). We'll actually be designing an Events Calendar control. This control will display currently active events (for the month) from different company departments for easy and straightforward access. The distributed 'live update' nature of this control eliminates the need for consolidating events information in a centralized database. In Chapters 6 and 7 we put our design into code. Using Visual C++ 5.0 and MFC 4.21, we'll be building the actual Events Calendar intranet control. The control class and custom wizard provided by MFC greatly simplify much of the development. We'll also be building two additional 'back-end' ActiveX controls using ATL 2.1 to do data processing for the Visual Calendar control. Finally, we will test the controls and show that the Calendar control is a bona fide ActiveX control that can be hosted within containers such as Visual Basic 5.0, Internet Explorer 3.0, and FrontPage 97. In Chapter 8, we shift into the highest gear and attempt to put the Calendar control through its paces by using DCOM to run the front-end and back-end ActiveX controls across three separate machines. Along the way, we'll learn a lot about DCOM and how it enables true distributed computing. We'll also be examining the difficult problem of ActiveX control code installation and revision control, and see how the Internet Explorer 3.0 provides us with a ready-made solution to the problem. As part of the installation solution, we'll develop a small program to download controls from remote sites. After the intensive programming in Chapter 8, we shift our focus to a hot intranet issue in Chapter 9: security. We'll examine the topic by drawing a parallel to the Windows NT security model which is fundamental to all other security mechanisms built upon it. We'll learn about the various security, authentication and encryption APIs and COM interfaces available to intranet application developers. Special attention will be paid to DCOM related security issues and how arbitrary distributed objects may be prevented or allowed to execute on certain machines. We conclude our coverage in Chapter 10 by casting aside our overly enthusiastic attitude and examine some real and hard-to-tackle ActiveX and intranet deployment issues, suggesting potential solutions wherever they are available. We'll cover a lot of ground in the following pages. I hope your journey into the exciting world of ActiveX will be as pleasant, productive, and profitable for you as it has been for us. What You Need to Use This Book To use this book you need Visual C++ 5.0, and the latest version of Microsoft's best-selling C++ compiler. This version is 32-bit only, so you'll need to install it on Windows 95, Windows NT 3.51 or NT 4, which means a 486 CPU or better and a minimum 16Mb of memory. For Visual C++, you'll need quite a lot of hard disk space - a typical installation is 170 Mbytes. You can do a minimal installation which takes up around 40 Mbytes, but this will mean longer compile times as the CD-Rom will be utilized more often. Some of the later chapters require you to have access to a network and a second computer to test the code correctly. You'll also need to have DCOM for Windows 95 (information on obtaining this is given in Chapter 8) or Windows NT 4.0. |AUTHORBIO: Bitten by the microcomputer bug since 1978, Sing has grown up with the microprocessor age. His first personal computer was a $99 do-it-yourself Netronics COSMIC ELF computer with 256 bytes of memory, mail ordered from the back pages of Popular Electronics magazine. Currently, Sing is an active author, consultant, and entrepreneur. He has written for popular technical journals and is the creator of the "Internet Global Phone", one of the very first Internet phones available. His wide-ranging consulting expertise spans Internet and Intranet systems design, distributed architectures, digital convergence, embedded systems, real-time technologies, and cross platform software design. Recently, he has completed an assignment with Nortel Multimedia Labs working in Computer Telephony Integration, and Advanced Callcenter Management products. Sing is a founder of microWonders, an emerging company specializing in products to fulfill the ubiquitous "computing anywhere" vision. Other titles by this author: ATL Programmer's Resource Kit Professional COM Applications with ATL Professional IE4 Programming Visual C++ 4 Master Class|AUTHORBIO: Panos Economopoulos has been the architect, designer and leader for implementations of a number of complex and successful distributed computer systems. Currently, he is Manager of Research and Development at Telesis North. Here, he designed the OnAir series of mobile client-server products that provide efficient and robust remote access to BackOffice servers over a variety of satellite and other wireless networks. He has extensive experience as a consultant to the Industry and has developed, and taught, a variety of courses both at University undergrad level and for mature developers. He's also carried out advanced research at the University of Toronto - results of which have been published in several research journals. Other titles by this author ATL Programmer's Resource Kit, Professional COM Applications with ATL|

Product Details

ISBN-13:
9781861000378
Publisher:
Wrox Press, Inc.
Publication date:
02/23/1997
Pages:
500
Product dimensions:
7.29(w) x 9.26(h) x 1.32(d)

Customer Reviews

Average Review:

Post to your social network

     

Most Helpful Customer Reviews

See all customer reviews