Excerpts from "Building Internet Applications..."

Table of Contents

 

Introduction
What this book is
What this book is NOT
Purpose of this book
History
Microsoft on the net
My involvement
About MFC
Scope of the book
Chapter Overview
Combining Technologies
What you need
Chapter 1: Internet Explorer as Application Framework

Zengineering

Code reuse
Exceptions
Smart classes
No errors

Browser as Application

NC
Win98/Win95/NT4/NT5/IE4/Desktop
Controls and Automation servers

HTML

DHTML
HTML Styles and Cascading Style Sheets (CSS)
Important HTML tags

Software Design

Issues
Design
Environment

Security

The Sandbox
Signing
CABs, ZIPs, JARs
 

Chapter 2 COM

Component-based Windows
  • Introduction to COM
    GDI + COM = DirectX
    The OLE Clipboard
  • COM tools
  • OLEVIEW (TTFKA OLE2VW32)
    REGEDIT
    GUIDGEN
    DOBJVIEW
    IROTVIEW
    TSTCON32
    PVIEW
  • Chapter 3 – Building COM objects

    Building COM objects with MFC

    MFC Interface support

    Building COM objects with ATL

    Template Refresher
    STL, Standard runtime
    ATL for COM

    Building COM objects in Visual Basic

    Automation Servers
    ActiveX Controls
    Example "GetFiles"

    Building COM objects in Java

    Example using JavaReg to Expose a Java class
    Events
    JActiveX
    JavaReg
    ActiveX Wizard for Java
    Using JDirect
    Server instantiation

    Building COM objects in…HTML

    Chapter 4 Builtin controls

    Common Controls

    Building a "subclass" ActiveX control

    IE Components

    shdocvw.dll
    mshtml.dll

    other IE controls

    Direct animation
    database controls – OLEDB
    ie controls
    HTML Help

    Other controls

    COMCTL32.OCX
    Using the ImageList control
    ActiveX Control Pad controls

    Chapter 5: Using COM objects

    COM-ActiveX Matrix
  • What’s an Automation Server?
    And an ActiveX Control?
  • Using COM objects in C++
  • COM non-automation ("custom") interfaces
    Using automation objects from MFC
    Using controls in a dialog box
    COMDEF and #import
    Example, a Checkbook
  • Using COM objects in Java
  • Using an Automation server
    package com.ms.ActiveX
    Example – An ActiveX Grid control
  • Using COM objects in HTML
  • Scripting with VBScript
    Scripting with JScript
    Important differences between VBScript and JScript
    The Document Object Model
    Automation Objects and Controls
    Example: object dragging
  • Chapter 6 Logistics

    Retrofitting COM automation
  • An EXE application
    A DLL
    MFC programs (EXE)
    MFC DLLs
  • Debugging web applications
  • Debugging ActiveX components
    Debugging Java components
    Debugging scripts (client)
    Server-side debugging
  • Browser
  • Browser checking
    Netscape
    extending the browser
    IEAK customization
  • FrontPage Server Extensions
  • For Windows, Unix
    Webs
    Tools
    FrontPage SDK
    WebPost
  • Chapter 7 Distributed Programming

    Message based
  • HTTP protocol
    TCP/IP protocols and Sockets
  • Object based
  • Proxies and Stubs
    RDS
    DCOM
    MTS Components
    RMI
  • Chapter 8 Server-side programming

    HTTP
    ISAPI
  • Registry
    ISAPI components
    MFC support
  • ADISAPI
    ASP
  • Object Model
    Server-side includes
    GLOBAL.ASA
    Non-HTML data
    Server-side objects (MSWC)
    Design-time controls
  • Web server security
    Custom servers
  • HTTP extensible
    other ports
    Java servlets
  • Server Side Summary

    Chapter 9 Installation and Signing

    Packaging
  • CAB tools
    Signing
  • Internet Component Download
  • CODEBASE specification
    INF files
    OSD files
    Versions
  • Active Setup
    Setup API
  • INF file sections
  • Chapter 10 Stupid Windows Tricks

    Common Mistakes I’ve seen (and done)
  • QueryInterface without &
    Register an object from removeable media
    Switching between JScript and VBScript
    Using Unicode on Win95
    Codebase set to DLL control on IIS
    JScript case sensitivity
    Mixing "s
    Closing the <SCRIPT> block
    Closing the <OBJECT> tag
  • Stupid Windows Tricks
  • Non-automation interfaces
    Using Java within a program
    Using VBScript within a program
    Windows Scripting Host
    Using Active Documents
    Accessing the HTML object model
    ShowHTMLDialog
    XML
  • Chapter 11 Conclusion

    Jason’s Top Ten Tips
    The Future
  • Visual Studio 6
    Windows CE
    Server-side programming
    OLE DB
    My Vision

  • What this book is

    First and foremost, this is a book about components. Using components, developing components, combining components, finding components. Component-based programming is an extremely efficient way of developing complex applications. And the best thing about it is that Windows is already chock full of powerful components just waiting to be re-used. Re-use is truly the holy grail of software development but the latest component development techniques have begun to make it a realizeable goal. In 1985, Brad Cox was one of the first to envision the concept of "software IC's" that could be purchased and easily integrated together, perhaps on a "software board". He went from there to object-oriented programming which produces source-level components, but the idea of re-useable components becomes most useful at a binary level. This is where today's standards, like Java Beans and ActiveX controls really start to make a difference. HTML pages and "layout controls" can be viewed as the "board" into which components can be "plugged in". And scripting code becomes the "wiring" to hook up the components.

    back to top


    About MFC

    It saddens me to see a whole crop of new Windows programmers who only know Windows through MFC. Windows is a wonderful, sometimes quirky operating system and MFC covers it all up with a big, fat, ugly library. The good news is that MFC hides the ugliness of Windows (under its own ugliness!). The bad news is that MFC hides the elegance of Windows (under its own ugliness). I've met too many MFC programmers who don't understand the difference between MFC and Windows and it's difficult to break them out of their MFC cocoons to see that using COM objects within HTML or VB is lower in overhead, lower in learning curve time, and faster to develop. What's particularly ironic is that about 6 years ago, when MFC was the only game in town and I was trying to convince managers and developers to use MFC instead of writing directly to Windows, I was told that MFC was too much of a toy for "commercial" applications.

    Now, I'm hearing that same excuse for not writing in HTML / JScript / ATL! COM objects can be programmed through MFC, but MFC's implementation of COM is ugly - utilizing nested class declarations and macros, macros, macros. I'll have more on this in Chapter 3, Building COM objects, and I'll also discuss implmenting COM with ATL. ATL is based on C++ templates (with a few macros thrown in) and it lets you get build simple, elegant, close-to-the-metal, COM objects easily. I wouldn't want to build a COM control host, though - that's where the bulkiness of MFC comes in handy. MFC implements enough of the features of Internet Explorer to act as a COM control container. Although Internet Explorer includes a lot of other features that would be difficult and annoying to write in MFC.

    In chapter 1, I discuss my philosophy of programming, "Zen-gineering". This is the art and science of implementing features without writing code. MFC is about as anti-Zen-gineering as anything could be, requiring mountains of code to do the simplest tasks. Of course, if job security is your goal (along with long schedules and hours of debugging), maybe MFC is the environment of choice. I've been there. I got out. Save yourself!

    back to top


    Zengineering

    A few years ago, I coined the term Zen-gineering which meant the implementation of features without coding or through removal of code. This may seem like a contradiction in terms and in reality, it's more of an axiom than a methodology. That being the best way to implement a feature is without coding it. Less code means less bugs, less to maintain, less work to add additional functionality. There are many ways that zengineering can be done -- using a browser as an application framework is one of the best.

    back to top

    ŠJason S. Loveman, 2003
    Last modified: August 1, 2003