在好例子网,分享、交流、成长!
您当前所在位置:首页C/C++ 开发实例C/C++语言基础 → Borland.C++.Builder.6.Developer's.Guide

Borland.C++.Builder.6.Developer's.Guide

C/C++语言基础

下载此实例
  • 开发语言:C/C++
  • 实例大小:15.30M
  • 下载次数:6
  • 浏览次数:44
  • 发布时间:2022-03-06
  • 实例类别:C/C++语言基础
  • 发 布 人:frankpine
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: Builder develop GUIDE GUID c++

实例介绍

【实例简介】Borland.C .Builder.6.Developer's.Guide

【实例截图】

【核心代码】

Contents
ii
Commonly used routines for
null-terminated strings. . . . . . . . . . . .4-23
Printing . . . . . . . . . . . . . . . . . . . . . . .4-25
Converting measurements . . . . . . . . . . . .4-25
Performing conversions . . . . . . . . . . . .4-26
Performing simple conversions . . . . . .4-26
Performing complex conversions . . . . .4-26
Adding new measurement types. . . . . . .4-26
Creating a simple conversion family
and adding units . . . . . . . . . . . . . . .4-27
Declare variables . . . . . . . . . . . . . .4-27
Register the conversion family . . . . . .4-27
Register measurement units . . . . . . . .4-27
Use the new units. . . . . . . . . . . . . .4-28
Using a conversion function . . . . . . . . .4-28
Declare variables . . . . . . . . . . . . . .4-28
Register the conversion family . . . . . .4-28
Register the base unit. . . . . . . . . . . .4-29
Write methods to convert to and
from the base unit. . . . . . . . . . . . .4-29
Register the other units. . . . . . . . . . .4-29
Use the new units. . . . . . . . . . . . . .4-29
Using a class to manage conversions. . . . .4-30
Creating the conversion class . . . . . . .4-30
Declare variables . . . . . . . . . . . . . .4-31
Register the conversion family and
the other units . . . . . . . . . . . . . . .4-31
Use the new units. . . . . . . . . . . . . .4-32
Creating drawing spaces . . . . . . . . . . . . .4-33
Chapter 5
Working with components 5-1
Setting component properties . . . . . . . . . . 5-2
Setting properties at design time . . . . . . . 5-2
Using property editors . . . . . . . . . . . 5-2
Setting properties at runtime . . . . . . . . . 5-3
Calling methods . . . . . . . . . . . . . . . . . . 5-3
Working with events and event
handlers . . . . . . . . . . . . . . . . . . . . . . 5-3
Generating a new event handler . . . . . . . 5-4
Generating a handler for a component’s
default event . . . . . . . . . . . . . . . . . 5-4
Locating event handlers . . . . . . . . . . . . 5-4
Associating an event with an existing
event handler . . . . . . . . . . . . . . . . . 5-4
Using the Sender parameter. . . . . . . . 5-5
Displaying and coding shared
events. . . . . . . . . . . . . . . . . . . . 5-5
Associating menu events with event
handlers. . . . . . . . . . . . . . . . . . . . . 5-5
Deleting event handlers . . . . . . . . . . . . 5-6
Cross-platform and non-cross-platform
components . . . . . . . . . . . . . . . . . . . . 5-6
Adding custom components to the
Component palette . . . . . . . . . . . . . . 5-8
Chapter 6
Working with controls 6-1
Implementing drag and drop in controls. . . . . 6-1
Starting a drag operation. . . . . . . . . . . . 6-1
Accepting dragged items. . . . . . . . . . . . 6-2
Dropping items . . . . . . . . . . . . . . . . . 6-2
Ending a drag operation . . . . . . . . . . . . 6-3
Customizing drag and drop with a
drag object . . . . . . . . . . . . . . . . . . . 6-3
Changing the drag mouse pointer. . . . . . . 6-4
Implementing drag and dock in controls. . . . . 6-4
Making a windowed control a docking
site. . . . . . . . . . . . . . . . . . . . . . . . 6-4
Making a control a dockable child. . . . . . . 6-4
Controlling how child controls are
docked . . . . . . . . . . . . . . . . . . . . . 6-5
Controlling how child controls are
undocked. . . . . . . . . . . . . . . . . . . . 6-6
Controlling how child controls respond
to drag-and-dock operations . . . . . . . . . 6-6
Working with text in controls . . . . . . . . . . . 6-6
Setting text alignment. . . . . . . . . . . . . . 6-7
Adding scroll bars at runtime . . . . . . . . . 6-7
Adding the clipboard object . . . . . . . . . . 6-8
Selecting text. . . . . . . . . . . . . . . . . . . 6-8
Selecting all text . . . . . . . . . . . . . . . . . 6-8
Cutting, copying, and pasting text . . . . . . 6-9
Deleting selected text . . . . . . . . . . . . . . 6-9
Disabling menu items. . . . . . . . . . . . . . 6-9
Providing a pop-up menu . . . . . . . . . . 6-10
Handling the OnPopup event . . . . . . . . 6-10
Adding graphics to controls . . . . . . . . . . . 6-11
Indicating that a control is owner-
drawn. . . . . . . . . . . . . . . . . . . . . 6-11
Adding graphical objects to a string
list . . . . . . . . . . . . . . . . . . . . . . . 6-12
Adding images to an application . . . . 6-12
Adding images to a string list . . . . . . 6-12
Drawing owner-drawn items. . . . . . . 6-13
Sizing owner-draw items. . . . . . . . . . . 6-14
Drawing owner-draw items . . . . . . . . . 6-14
iii
Chapter 7
Building applications, components,
and libraries 7-1
Creating applications . . . . . . . . . . . . . . . 7-1
GUI applications . . . . . . . . . . . . . . . . 7-1
User interface models . . . . . . . . . . . 7-2
SDI applications. . . . . . . . . . . . . . . 7-2
MDI applications . . . . . . . . . . . . . . 7-2
Setting IDE, project, and compilation
options . . . . . . . . . . . . . . . . . . . 7-3
Programming templates. . . . . . . . . . . . 7-3
Console applications. . . . . . . . . . . . . . 7-4
Using the VCL and CLX in console
applications . . . . . . . . . . . . . . . . 7-4
Service applications . . . . . . . . . . . . . . 7-4
Service threads . . . . . . . . . . . . . . . 7-7
Service name properties . . . . . . . . . . 7-8
Debugging service applications. . . . . . 7-9
Creating packages and DLLs . . . . . . . . . . .7-10
When to use packages and DLLs . . . . . . .7-11
Using DLLs in C Builder . . . . . . . . . . . .7-11
Creating DLLs in C Builder . . . . . . . . . .7-11
Creating DLLs containing VCL and CLX
components. . . . . . . . . . . . . . . . . . . .7-12
Linking DLLs. . . . . . . . . . . . . . . . . . . .7-15
Writing database applications . . . . . . . . . .7-15
Distributing database applications . . . . . .7-16
Creating Web server applications . . . . . . . .7-16
Using Web Broker . . . . . . . . . . . . . . .7-17
Creating WebSnap applications. . . . . . . .7-18
Using InternetExpress . . . . . . . . . . . . .7-18
Creating Web Services applications . . . . .7-18
Writing applications using COM. . . . . . . . .7-19
Using COM and DCOM. . . . . . . . . . . .7-19
Using MTS and COM . . . . . . . . . . . .7-19
Using data modules . . . . . . . . . . . . . . . .7-20
Creating and editing standard
data modules . . . . . . . . . . . . . . . . .7-20
Naming a data module and its
unit file . . . . . . . . . . . . . . . . . . .7-21
Placing and naming components . . . . .7-22
Using component properties and
events in a data module . . . . . . . . .7-22
Creating business rules in a data
module . . . . . . . . . . . . . . . . . . .7-23
Accessing a data module from a form . . . .7-23
Adding a remote data module to an
application server project . . . . . . . . . .7-23
Using the Object Repository . . . . . . . . . . .7-24
Sharing items within a project . . . . . . . . 7-24
Adding items to the Object Repository . . . 7-24
Sharing objects in a team
environment . . . . . . . . . . . . . . . . . 7-24
Using an Object Repository item in
a project. . . . . . . . . . . . . . . . . . . . 7-25
Copying an item . . . . . . . . . . . . . . 7-25
Inheriting an item . . . . . . . . . . . . . 7-25
Using an item. . . . . . . . . . . . . . . . 7-25
Using project templates. . . . . . . . . . . . 7-25
Modifying shared items . . . . . . . . . . . 7-26
Specifying a default project, new form,
and main form . . . . . . . . . . . . . . . . 7-26
Enabling Help in applications. . . . . . . . . . 7-26
Help system interfaces . . . . . . . . . . . . 7-27
Implementing ICustomHelpViewer. . . . . 7-28
Communicating with the Help
Manager . . . . . . . . . . . . . . . . . . . 7-28
Asking the Help Manager for
information. . . . . . . . . . . . . . . . . . 7-28
Displaying keyword-based Help . . . . . . 7-29
Displaying tables of contents. . . . . . . . . 7-30
Implementing IExtendedHelp
Viewer . . . . . . . . . . . . . . . . . . . . 7-30
Implementing IHelpSelector . . . . . . . . . 7-31
Registering Help system objects. . . . . . . 7-32
Registering Help viewers . . . . . . . . . 7-32
Registering Help selectors . . . . . . . . 7-32
Using Help in a VCL Application. . . . . . . . 7-33
How TApplication processes VCL
Help. . . . . . . . . . . . . . . . . . . . . . 7-33
How VCL controls process Help. . . . . . . 7-33
Using Help in a CLX Application. . . . . . . . 7-34
How TApplication processes CLX
Help. . . . . . . . . . . . . . . . . . . . . . 7-34
How CLX controls process Help. . . . . . . 7-34
Calling a Help system directly . . . . . . . . . 7-35
Using IHelpSystem . . . . . . . . . . . . . . . . 7-35
Customizing the IDE Help system . . . . . . . 7-35
Chapter 8
Developing the application user
interface 8-1
Controlling application behavior . . . . . . . . . 8-1
Working at the application level. . . . . . . . 8-2
Handling the screen. . . . . . . . . . . . . . . 8-2
Setting up forms. . . . . . . . . . . . . . . . . . . 8-2
Using the main form . . . . . . . . . . . . . . 8-2
Hiding the main form. . . . . . . . . . . . . . 8-3
iv
Adding forms. . . . . . . . . . . . . . . . . . 8-3
Linking forms . . . . . . . . . . . . . . . . 8-3
Managing layout . . . . . . . . . . . . . . . . 8-4
Using forms. . . . . . . . . . . . . . . . . . . . . 8-5
Controlling when forms reside in
memory . . . . . . . . . . . . . . . . . . . . 8-5
Displaying an auto-created form . . . . . 8-5
Creating forms dynamically. . . . . . . . 8-6
Creating modeless forms such as
windows . . . . . . . . . . . . . . . . . . 8-6
Creating a form instance using a local
variable. . . . . . . . . . . . . . . . . . . 8-7
Passing additional arguments to forms . . . 8-7
Retrieving data from forms . . . . . . . . . . 8-8
Retrieving data from modeless
forms . . . . . . . . . . . . . . . . . . . . 8-8
Retrieving data from modal forms . . . .8-10
Reusing components and groups of
components. . . . . . . . . . . . . . . . . . . .8-12
Creating and using component templates . . .8-12
Working with frames . . . . . . . . . . . . . . .8-13
Creating frames. . . . . . . . . . . . . . . . .8-13
Adding frames to the Component
palette . . . . . . . . . . . . . . . . . . . . .8-14
Using and modifying frames . . . . . . . . .8-14
Sharing frames . . . . . . . . . . . . . . . . .8-15
Developing dialog boxes . . . . . . . . . . . . .8-15
Using open dialog boxes. . . . . . . . . . . .8-16
Organizing actions for toolbars and
menus . . . . . . . . . . . . . . . . . . . . . . .8-16
What is an action? . . . . . . . . . . . . . . .8-18
Setting up action bands . . . . . . . . . . . .8-18
Creating toolbars and menus . . . . . . . . .8-19
Adding color, patterns, or pictures
to menus, buttons, and toolbars. . . . .8-20
Adding icons to menus and
toolbars. . . . . . . . . . . . . . . . . . .8-21
Creating toolbars and menus that
users can customize. . . . . . . . . . . .8-22
Hiding unused items and categories
in action bands . . . . . . . . . . . . . .8-22
Using action lists. . . . . . . . . . . . . . . . . .8-23
Setting up action lists . . . . . . . . . . . . .8-23
What happens when an action fires . . . . .8-24
Responding with events . . . . . . . . . .8-24
How actions find their targets. . . . . . .8-26
Updating actions . . . . . . . . . . . . . . . .8-26
Predefined action classes . . . . . . . . . . .8-27
Writing action components . . . . . . . . . .8-28
Registering actions . . . . . . . . . . . . . . 8-28
Creating and managing menus . . . . . . . . . 8-29
Opening the Menu Designer. . . . . . . . . 8-30
Building menus . . . . . . . . . . . . . . . . 8-30
Naming menus. . . . . . . . . . . . . . . 8-31
Naming the menu items . . . . . . . . . 8-31
Adding, inserting, and deleting menu
items. . . . . . . . . . . . . . . . . . . . 8-31
Adding separator bars . . . . . . . . . . 8-33
Specifying accelerator keys and
keyboard shortcuts. . . . . . . . . . . . 8-33
Creating submenus . . . . . . . . . . . . . . 8-34
Creating submenus by demoting
existing menus . . . . . . . . . . . . . . 8-34
Moving menu items . . . . . . . . . . . . 8-35
Adding images to menu items . . . . . . 8-35
Viewing the menu . . . . . . . . . . . . . 8-36
Editing menu items in the Object
Inspector . . . . . . . . . . . . . . . . . . . 8-36
Using the Menu Designer context
menu . . . . . . . . . . . . . . . . . . . . . 8-37
Commands on the context menu. . . . . 8-37
Switching between menus at design
time . . . . . . . . . . . . . . . . . . . . 8-37
Using menu templates . . . . . . . . . . . . 8-38
Saving a menu as a template. . . . . . . . . 8-39
Naming conventions for template
menu items and event handlers . . . . 8-40
Manipulating menu items at runtime. . . . 8-40
Merging menus . . . . . . . . . . . . . . . . 8-41
Specifying the active menu: Menu
property. . . . . . . . . . . . . . . . . . 8-41
Determining the order of merged
menu items: GroupIndex property. . . 8-41
Importing resource files . . . . . . . . . . . 8-42
Designing toolbars and cool bars . . . . . . . . 8-42
Adding a toolbar using a panel
component . . . . . . . . . . . . . . . . . . 8-43
Adding a speed button to a panel . . . . 8-44
Assigning a speed button’s glyph . . . . 8-44
Setting the initial condition of a
speed button . . . . . . . . . . . . . . . 8-44
Creating a group of speed buttons. . . . 8-45
Allowing toggle buttons . . . . . . . . . 8-45
Adding a toolbar using the toolbar
component . . . . . . . . . . . . . . . . . . 8-45
Adding a tool button . . . . . . . . . . . 8-46
Assigning images to tool buttons . . . . 8-46
v
Setting tool button appearance and
initial conditions . . . . . . . . . . . . .8-46
Creating groups of tool buttons . . . . . .8-47
Allowing toggled tool buttons . . . . . .8-47
Adding a cool bar component . . . . . . . .8-47
Setting the appearance of the cool
bar . . . . . . . . . . . . . . . . . . . . .8-48
Responding to clicks . . . . . . . . . . . . . .8-48
Assigning a menu to a tool button . . . .8-48
Adding hidden toolbars . . . . . . . . . . . .8-49
Hiding and showing toolbars. . . . . . . . .8-49
Chapter 9
Types of controls 9-1
Text controls . . . . . . . . . . . . . . . . . . . . 9-1
Edit controls. . . . . . . . . . . . . . . . . . . 9-2
Edit control properties. . . . . . . . . . . . . 9-2
Memo and rich edit controls. . . . . . . . 9-2
Text viewing controls (CLX only). . . . . . . 9-3
Labels . . . . . . . . . . . . . . . . . . . . . . 9-3
Specialized input controls. . . . . . . . . . . . . 9-4
Scroll bars . . . . . . . . . . . . . . . . . . . . 9-4
Track bars . . . . . . . . . . . . . . . . . . . . 9-5
Up-down controls (VCL only) . . . . . . . . 9-5
Spin edit controls (CLX only) . . . . . . . . . 9-5
Hot key controls (VCL only) . . . . . . . . . 9-5
Splitter controls. . . . . . . . . . . . . . . . . 9-6
Buttons and similar controls . . . . . . . . . . . 9-6
Button controls . . . . . . . . . . . . . . . . . 9-6
Bitmap buttons . . . . . . . . . . . . . . . . . 9-7
Speed buttons. . . . . . . . . . . . . . . . . . 9-7
Check boxes. . . . . . . . . . . . . . . . . . . 9-7
Radio buttons. . . . . . . . . . . . . . . . . . 9-8
Toolbars . . . . . . . . . . . . . . . . . . . . . 9-8
Cool bars (VCL only). . . . . . . . . . . . . . 9-8
List controls. . . . . . . . . . . . . . . . . . . . . 9-9
List boxes and check-list boxes . . . . . . . . 9-9
Combo boxes . . . . . . . . . . . . . . . . . .9-10
Tree views . . . . . . . . . . . . . . . . . . . .9-10
List views . . . . . . . . . . . . . . . . . . . .9-11
Date-time pickers and month
calendars (VCL only). . . . . . . . . . . . .9-11
Grouping controls . . . . . . . . . . . . . . . . .9-11
Group boxes and radio groups . . . . . . . .9-12
Panels . . . . . . . . . . . . . . . . . . . . . .9-12
Scroll boxes . . . . . . . . . . . . . . . . . . .9-12
Tab controls . . . . . . . . . . . . . . . . . . .9-13
Page controls . . . . . . . . . . . . . . . . . .9-13
Header controls. . . . . . . . . . . . . . . . .9-13
Display controls. . . . . . . . . . . . . . . . . . 9-14
Status bars . . . . . . . . . . . . . . . . . . . 9-14
Progress bars. . . . . . . . . . . . . . . . . . 9-14
Help and hint properties . . . . . . . . . . . 9-15
Grids . . . . . . . . . . . . . . . . . . . . . . . . 9-15
Draw grids . . . . . . . . . . . . . . . . . . . 9-15
String grids. . . . . . . . . . . . . . . . . . . 9-15
Value list editors (VCL only). . . . . . . . . . . 9-16
Graphic controls. . . . . . . . . . . . . . . . . . 9-16
Images . . . . . . . . . . . . . . . . . . . . . 9-17
Shapes . . . . . . . . . . . . . . . . . . . . . 9-17
Bevels. . . . . . . . . . . . . . . . . . . . . . 9-17
Paint boxes . . . . . . . . . . . . . . . . . . . 9-17
Animation control (VCL only) . . . . . . . . 9-17
Chapter 10
Working with graphics and
multimedia 10-1
Overview of graphics programming . . . . . . 10-1
Refreshing the screen . . . . . . . . . . . . . 10-2
Types of graphic objects . . . . . . . . . . . 10-3
Common properties and methods
of Canvas . . . . . . . . . . . . . . . . . . . 10-4
Using the properties of the Canvas
object . . . . . . . . . . . . . . . . . . . . . 10-5
Using pens . . . . . . . . . . . . . . . . . 10-5
Using brushes . . . . . . . . . . . . . . . 10-8
Reading and setting pixels . . . . . . . . 10-9
Using Canvas methods to draw graphic
objects. . . . . . . . . . . . . . . . . . . . 10-10
Drawing lines and polylines . . . . . . 10-10
Drawing shapes . . . . . . . . . . . . . .10-11
Handling multiple drawing objects
in your application . . . . . . . . . . . . 10-12
Keeping track of which drawing
tool to use. . . . . . . . . . . . . . . . 10-12
Changing the tool with speed
buttons . . . . . . . . . . . . . . . . . 10-13
Using drawing tools. . . . . . . . . . . 10-13
Drawing on a graphic. . . . . . . . . . . . 10-16
Making scrollable graphics . . . . . . . 10-17
Adding an image control . . . . . . . . 10-17
Loading and saving graphics files. . . . . 10-19
Loading a picture from a file . . . . . . 10-19
Saving a picture to a file. . . . . . . . . 10-20
Replacing the picture . . . . . . . . . . 10-20
Using the clipboard with graphics . . . . 10-21
Copying graphics to the
clipboard . . . . . . . . . . . . . . . . 10-22
vi
Cutting graphics to the clipboard. . . . 10-22
Pasting graphics from the
clipboard. . . . . . . . . . . . . . . . . 10-22
Rubber banding example . . . . . . . . . . 10-23
Responding to the mouse . . . . . . . . 10-24
Responding to a mouse-down
action . . . . . . . . . . . . . . . . . . . 10-25
Adding a field to a form object
|to track mouse actions . . . . . . . . 10-26
Refining line drawing . . . . . . . . . . 10-27
Working with multimedia . . . . . . . . . . . 10-29
Adding silent video clips to an
application. . . . . . . . . . . . . . . . . . 10-29
Example of adding silent video
clips. . . . . . . . . . . . . . . . . . . . 10-30
Adding audio and/or video clips to
an application. . . . . . . . . . . . . . . . 10-31
Example of adding audio and/or
video clips (VCL only) . . . . . . . . . 10-33
Chapter 11
Writing multi-threaded applications 11-1
Defining thread objects . . . . . . . . . . . . . .11-1
Initializing the thread . . . . . . . . . . . . .11-2
Assigning a default priority . . . . . . . .11-2
Indicating when threads are freed . . . .11-3
Writing the thread function . . . . . . . . . .11-4
Using the main VCL/CLX thread. . . . .11-4
Using thread-local variables. . . . . . . .11-5
Checking for termination by other
threads . . . . . . . . . . . . . . . . . . .11-6
Handling exceptions in the thread
function . . . . . . . . . . . . . . . . . .11-6
Writing clean-up code . . . . . . . . . . . . .11-7
Coordinating threads . . . . . . . . . . . . . . .11-7
Avoiding simultaneous access . . . . . . . .11-7
Locking objects . . . . . . . . . . . . . . .11-7
Using critical sections . . . . . . . . . . .11-8
Using the multi-read exclusive-write
synchronizer. . . . . . . . . . . . . . . .11-8
Other techniques for sharing
memory . . . . . . . . . . . . . . . . . .11-9
Waiting for other threads . . . . . . . . . . .11-9
Waiting for a thread to finish
executing. . . . . . . . . . . . . . . . . .11-9
Waiting for a task to be
completed . . . . . . . . . . . . . . . . 11-10
Executing thread objects . . . . . . . . . . . . 11-11
Overriding the default priority . . . . . . . 11-11
Starting and stopping threads . . . . . . . .11-11
Debugging multi-threaded applications . . . .11-12
Naming a thread. . . . . . . . . . . . . . . .11-12
Converting an unnamed thread to a named
thread . . . . . . . . . . . . . . . . . . .11-12
Assigning separate names to similar
threads . . . . . . . . . . . . . . . . . .11-13
Chapter 12
Exception handling 12-1
C exception handling . . . . . . . . . . . . . 12-1
Exception handling syntax . . . . . . . . . . 12-1
The try block . . . . . . . . . . . . . . . . 12-2
The throw statement. . . . . . . . . . . . 12-2
The catch statement . . . . . . . . . . . . 12-3
Rethrowing exceptions . . . . . . . . . . . . 12-4
Exception specifications . . . . . . . . . . . 12-4
Unwinding exceptions . . . . . . . . . . . . 12-5
Safe pointers . . . . . . . . . . . . . . . . 12-5
Constructors in exception handling. . . . . 12-6
Handling uncaught and unexpected
exceptions . . . . . . . . . . . . . . . . . . 12-6
Structured exceptions under Win32. . . . . . . 12-6
Syntax of structured exceptions . . . . . . . 12-7
Handling structured exceptions . . . . . . . 12-8
Exception filters . . . . . . . . . . . . . . . . 12-8
Mixing C with structured
exceptions . . . . . . . . . . . . . . . . . 12-10
C-based exceptions in C program
example . . . . . . . . . . . . . . . . . .12-11
Defining exceptions . . . . . . . . . . . . . 12-12
Raising exceptions. . . . . . . . . . . . . . 12-12
Termination blocks . . . . . . . . . . . . . 12-13
C Builder exception handling
options . . . . . . . . . . . . . . . . . . . 12-14
VCL/CLX exception handling . . . . . . . . 12-15
Differences between C and
VCL/CLX exception handling . . . . . . 12-15
Handling operating system exceptions . . 12-15
Handling VCL and CLX exceptions. . . . 12-16
VCL and CLX exception classes . . . . . . 12-16
Portability considerations . . . . . . . . . 12-18
Chapter 13
C language support for the
VCL and CLX 13-1
C and Object Pascal object models. . . . . . 13-1
Inheritance and interfaces . . . . . . . . . . 13-2
vii
Using interfaces instead of multiple
inheritance . . . . . . . . . . . . . . . . .13-2
Declaring interface classes . . . . . . . . .13-2
IUnknown and IInterface . . . . . . . . .13-3
Creating classes that support
IUnknown . . . . . . . . . . . . . . . . .13-4
Interfaced classes and lifetime
management. . . . . . . . . . . . . . . .13-5
Object identity and instantiation . . . . . . .13-5
Distinguishing C and Object
Pascal references . . . . . . . . . . . . .13-5
Copying objects . . . . . . . . . . . . . . .13-6
Objects as function arguments . . . . . .13-7
Object construction for C Builder
VCL/CLX classes. . . . . . . . . . . . . . .13-7
C object construction . . . . . . . . . .13-7
Object Pascal object construction . . . . .13-8
C Builder object construction . . . . . .13-8
Calling virtual methods in base class
constructors . . . . . . . . . . . . . . . . . 13-10
Object Pascal model . . . . . . . . . . . 13-10
C model. . . . . . . . . . . . . . . . . 13-11
C Builder model . . . . . . . . . . . . 13-11
Example: calling virtual methods. . . . 13-11
Constructor initialization of data
members for virtual functions. . . . . . 13-12
Object destruction . . . . . . . . . . . . . . 13-13
Exceptions thrown from
constructors . . . . . . . . . . . . . . . 13-13
Virtual methods called from
destructors . . . . . . . . . . . . . . . . 13-14
AfterConstruction and Before
Destruction . . . . . . . . . . . . . . . . . 13-14
Class virtual functions . . . . . . . . . . . . 13-15
Support for Object Pascal data types
and language concepts . . . . . . . . . . . . 13-15
Typedefs. . . . . . . . . . . . . . . . . . . . 13-15
Classes that support the Object
Pascal language. . . . . . . . . . . . . . . 13-16
C language counterparts to the
Object Pascal language. . . . . . . . . . . 13-16
Var parameters . . . . . . . . . . . . . . 13-16
Untyped parameters . . . . . . . . . . . 13-16
Open arrays. . . . . . . . . . . . . . . . . . 13-17
Calculating the number of
elements . . . . . . . . . . . . . . . . . 13-17
Temporaries . . . . . . . . . . . . . . . . 13-18
array of const . . . . . . . . . . . . . . . 13-18
OPENARRAY macro . . . . . . . . . . . 13-19
EXISTINGARRAY macro . . . . . . . . 13-19
C functions that take open array
arguments. . . . . . . . . . . . . . . . 13-19
Types defined differently. . . . . . . . . . 13-19
Boolean data types. . . . . . . . . . . . 13-19
Char data types . . . . . . . . . . . . . 13-20
Delphi interfaces. . . . . . . . . . . . . . . 13-20
Resource strings . . . . . . . . . . . . . . . 13-21
Default parameters . . . . . . . . . . . . . 13-21
Runtime type information . . . . . . . . . 13-22
Unmapped types . . . . . . . . . . . . . . 13-23
6-byte Real types. . . . . . . . . . . . . 13-23
Arrays as return types of
functions . . . . . . . . . . . . . . . . 13-23
Keyword extensions. . . . . . . . . . . . . 13-23
__classid . . . . . . . . . . . . . . . . . 13-23
__closure . . . . . . . . . . . . . . . . . 13-24
__property . . . . . . . . . . . . . . . . 13-26
__published. . . . . . . . . . . . . . . . 13-27
The __declspec keyword extension . . . . 13-28
__declspec(delphiclass) . . . . . . . . . 13-28
__declspec(delphireturn) . . . . . . . . 13-28
__declspec(delphirtti) . . . . . . . . . . 13-28
__declspec(dynamic) . . . . . . . . . . 13-29
__declspec(hidesbase). . . . . . . . . . 13-29
__declspec(package). . . . . . . . . . . 13-29
__declspec(pascalimplementation) . . 13-29
__declspec(uuid). . . . . . . . . . . . . 13-29
Chapter 14
Developing cross-platform
applications 14-1
Creating cross-platform applications . . . . . . 14-1
Porting Windows applications to Linux . . . . 14-2
Porting techniques . . . . . . . . . . . . . . 14-2
Platform-specific ports . . . . . . . . . . 14-2
Cross-platform ports . . . . . . . . . . . 14-3
Windows emulation ports . . . . . . . . 14-3
Porting your application . . . . . . . . . . . 14-3
CLX versus VCL. . . . . . . . . . . . . . . . 14-5
What CLX does differently. . . . . . . . . . 14-5
Look and feel. . . . . . . . . . . . . . . . 14-6
Styles . . . . . . . . . . . . . . . . . . . . 14-6
Variants . . . . . . . . . . . . . . . . . . . 14-6
Registry . . . . . . . . . . . . . . . . . . . 14-6
Other differences. . . . . . . . . . . . . . 14-7
Missing in CLX . . . . . . . . . . . . . . . . 14-7
Features that will not port directly . . . . . 14-8
CLX and VCL unit comparison . . . . . . . 14-8
viii
Differences in CLX object
constructors . . . . . . . . . . . . . . . . . 14-11
Handling system and widget
events . . . . . . . . . . . . . . . . . . . . 14-12
Sharing source files between
Windows and Linux . . . . . . . . . . . . 14-12
Environmental differences between
Windows and Linux . . . . . . . . . . . . 14-13
Directory structure on Linux . . . . . . . . 14-15
Writing portable code . . . . . . . . . . . . 14-15
Using conditional directives. . . . . . . 14-16
Emitting messages . . . . . . . . . . . . 14-17
Including inline assembler code. . . . . 14-18
Programming differences on Linux . . . . 14-19
Cross-platform database applications . . . . . 14-19
dbExpress differences . . . . . . . . . . . . 14-20
Component-level differences . . . . . . . . 14-21
User interface-level differences . . . . . . . 14-21
Porting database applications to
Linux. . . . . . . . . . . . . . . . . . . . . 14-22
Updating data in dbExpress
applications . . . . . . . . . . . . . . . . . 14-24
Cross-platform Internet applications . . . . . 14-25
Porting Internet applications to
Linux. . . . . . . . . . . . . . . . . . . . . 14-26
Chapter 15
Working with packages and
components 15-1
Why use packages? . . . . . . . . . . . . . . . .15-2
Packages and standard DLLs . . . . . . . . .15-2
Runtime packages . . . . . . . . . . . . . . . . .15-3
Using packages in an application. . . . . . .15-3
Dynamically loading packages . . . . . . . .15-4
Deciding which runtime packages
to use. . . . . . . . . . . . . . . . . . . . . .15-4
Custom packages. . . . . . . . . . . . . . . .15-4
Design-time packages . . . . . . . . . . . . . . .15-5
Installing component packages. . . . . . . .15-5
Creating and editing packages . . . . . . . . . .15-6
Creating a package . . . . . . . . . . . . . . .15-6
Editing an existing package . . . . . . . . . .15-7
Package source files and project
options files . . . . . . . . . . . . . . . . . .15-8
Packaging components. . . . . . . . . . .15-8
Understanding the structure of
a package . . . . . . . . . . . . . . . . . . .15-9
Naming packages. . . . . . . . . . . . . .15-9
Requires list . . . . . . . . . . . . . . . . .15-9
Contains list . . . . . . . . . . . . . . . 15-10
Building packages. . . . . . . . . . . . . . 15-10
Package-specific compiler
directives . . . . . . . . . . . . . . . . .15-11
Using the command-line compiler
and linker . . . . . . . . . . . . . . . . 15-12
Package files created by building . . . 15-12
Deploying packages . . . . . . . . . . . . . . 15-13
Deploying applications that use
packages . . . . . . . . . . . . . . . . . . 15-13
Distributing packages to other
developers . . . . . . . . . . . . . . . . . 15-13
Package collection files . . . . . . . . . . . 15-13
Chapter 16
Creating international
applications 16-1
Internationalization and localization . . . . . . 16-1
Internationalization . . . . . . . . . . . . . . 16-1
Localization . . . . . . . . . . . . . . . . . . 16-1
Internationalizing applications . . . . . . . . . 16-2
Enabling application code . . . . . . . . . . 16-2
Character sets . . . . . . . . . . . . . . . 16-2
OEM and ANSI character sets . . . . . . 16-2
Multibyte character sets. . . . . . . . . . 16-3
Wide characters . . . . . . . . . . . . . . 16-3
Including bi-directional functionality
in applications . . . . . . . . . . . . . . 16-4
BiDiMode property . . . . . . . . . . . . 16-6
Locale-specific features . . . . . . . . . . 16-8
Designing the user interface . . . . . . . . . 16-8
Text . . . . . . . . . . . . . . . . . . . . . 16-8
Graphic images . . . . . . . . . . . . . . 16-9
Formats and sort order . . . . . . . . . . 16-9
Keyboard mappings. . . . . . . . . . . . 16-9
Isolating resources. . . . . . . . . . . . . . 16-10
Creating resource DLLs. . . . . . . . . . . 16-10
Using resource DLLs . . . . . . . . . . . . .16-11
Dynamic switching of resource
DLLs . . . . . . . . . . . . . . . . . . . . 16-12
Localizing applications. . . . . . . . . . . . . 16-12
Localizing resources. . . . . . . . . . . . . 16-12
Chapter 17
Deploying applications 17-1
Deploying general applications . . . . . . . . . 17-1
Using installation programs . . . . . . . . . 17-2
Identifying application files . . . . . . . 17-2
Application files . . . . . . . . . . . . . . 17-3
ix
Package files. . . . . . . . . . . . . . . . .17-3
Merge modules . . . . . . . . . . . . . . .17-3
ActiveX controls . . . . . . . . . . . . . .17-5
Helper applications. . . . . . . . . . . . .17-5
DLL locations . . . . . . . . . . . . . . . .17-5
Deploying CLX applications . . . . . . . . . . .17-6
Deploying database applications. . . . . . . . .17-6
Deploying dbExpress database
applications . . . . . . . . . . . . . . . . . .17-7
Deploying BDE applications . . . . . . . . .17-8
Borland Database Engine . . . . . . . . .17-8
SQL Links . . . . . . . . . . . . . . . . . .17-9
Deploying multi-tiered database
applications (DataSnap) . . . . . . . . . . 17-10
Deploying Web applications . . . . . . . . . . 17-10
Deploying to Apache servers . . . . . . . . 17-10
Programming for varying host
environments . . . . . . . . . . . . . . . . . . 17-11
Screen resolutions and color depths . . . . 17-12
Considerations when not
dynamically resizing . . . . . . . . . . 17-12
Considerations when dynamically
resizing forms and controls . . . . . . 17-12
Accommodating varying color
depths . . . . . . . . . . . . . . . . . . 17-13
Fonts . . . . . . . . . . . . . . . . . . . . . . 17-14
Operating systems versions. . . . . . . . . 17-14
Software license requirements . . . . . . . . . 17-15
DEPLOY. . . . . . . . . . . . . . . . . . . . 17-15
README . . . . . . . . . . . . . . . . . . . 17-15
No-nonsense license agreement . . . . . . 17-15
Third-party product documentation . . . . 17-15
Part II
Developing database applications
Chapter 18
Designing database applications 18-1
Using databases . . . . . . . . . . . . . . . . . .18-1
Types of databases . . . . . . . . . . . . . . .18-2
Database security. . . . . . . . . . . . . . . .18-3
Transactions. . . . . . . . . . . . . . . . . . .18-4
Referential integrity, stored procedures,
and triggers . . . . . . . . . . . . . . . . . .18-5
Database architecture . . . . . . . . . . . . . . .18-5
General structure . . . . . . . . . . . . . . . .18-6
The user interface form. . . . . . . . . . .18-6
The data module . . . . . . . . . . . . . .18-6
Connecting directly to a database
server . . . . . . . . . . . . . . . . . . . . . 18-7
Using a dedicated file on disk . . . . . . . . 18-9
Connecting to another dataset . . . . . . . 18-10
Connecting a client dataset to another
dataset in the same application. . . . .18-11
Using a multi-tiered architecture. . . . 18-12
Combining approaches . . . . . . . . . . . 18-14
Designing the user interface . . . . . . . . . . 18-15
Analyzing data . . . . . . . . . . . . . . . 18-15
Writing reports. . . . . . . . . . . . . . . . 18-16
Chapter 19
Using data controls 19-1
Using common data control features . . . . . . 19-2
Associating a data control with a
dataset . . . . . . . . . . . . . . . . . . . . 19-3
Changing the associated dataset
at runtime. . . . . . . . . . . . . . . . . 19-3
Enabling and disabling the data
source . . . . . . . . . . . . . . . . . . . 19-4
Responding to changes mediated
by the data source . . . . . . . . . . . . 19-4
Editing and updating data . . . . . . . . . . 19-5
Enabling editing in controls on
user entry . . . . . . . . . . . . . . . . . 19-5
Editing data in a control. . . . . . . . . . 19-5
Disabling and enabling data display . . . . 19-6
Refreshing data display. . . . . . . . . . . . 19-6
Enabling mouse, keyboard, and timer
events . . . . . . . . . . . . . . . . . . . . . 19-7
Choosing how to organize the data. . . . . . . 19-7
Displaying a single record . . . . . . . . . . 19-7
Displaying data as labels . . . . . . . . . 19-8
Displaying and editing fields in an
edit box . . . . . . . . . . . . . . . . . . 19-8
Displaying and editing text in a
memo control. . . . . . . . . . . . . . . 19-8
Displaying and editing text in a rich
edit memo control . . . . . . . . . . . . 19-9
Displaying and editing graphics
fields in an image control . . . . . . . . 19-9
Displaying and editing data in list
and combo boxes. . . . . . . . . . . . 19-10
Handling Boolean field values with
check boxes . . . . . . . . . . . . . . . 19-13
Restricting field values with radio
controls . . . . . . . . . . . . . . . . . 19-13
Displaying multiple records . . . . . . . . 19-14
x
Viewing and editing data with
TDBGrid. . . . . . . . . . . . . . . . . . . . . 19-15
Using a grid control in its default
state . . . . . . . . . . . . . . . . . . . . . 19-15
Creating a customized grid . . . . . . . . . 19-16
Understanding persistent
columns . . . . . . . . . . . . . . . . . 19-17
Creating persistent columns. . . . . . . 19-17
Deleting persistent columns. . . . . . . 19-18
Arranging the order of persistent
columns . . . . . . . . . . . . . . . . . 19-19
Setting column properties at
design time . . . . . . . . . . . . . . . 19-19
Defining a lookup list column. . . . . . 19-20
Putting a button in a column . . . . . . 19-21
Restoring default values to a
column . . . . . . . . . . . . . . . . . . 19-21
Displaying ADT and array fields. . . . . . 19-22
Setting grid options . . . . . . . . . . . . . 19-24
Editing in the grid . . . . . . . . . . . . . . 19-25
Controlling grid drawing . . . . . . . . . . 19-25
Responding to user actions at
runtime . . . . . . . . . . . . . . . . . . . 19-26
Creating a grid that contains other
data-aware controls . . . . . . . . . . . . . . 19-27
Navigating and manipulating records. . . . . 19-28
Choosing navigator buttons to
display . . . . . . . . . . . . . . . . . . . . 19-29
Hiding and showing navigator
buttons at design time . . . . . . . . . 19-29
Hiding and showing navigator
buttons at runtime . . . . . . . . . . . 19-29
Displaying fly-over help. . . . . . . . . . . 19-30
Using a single navigator for multiple
datasets . . . . . . . . . . . . . . . . . . . 19-30
Chapter 20
Using decision support
components 20-1
Overview . . . . . . . . . . . . . . . . . . . . . .20-1
About crosstabs . . . . . . . . . . . . . . . . . .20-2
One-dimensional crosstabs . . . . . . . . . .20-2
Multidimensional crosstabs . . . . . . . . . .20-3
Guidelines for using decision support
components. . . . . . . . . . . . . . . . . . . .20-3
Using datasets with decision support
components. . . . . . . . . . . . . . . . . . . .20-4
Creating decision datasets with
TQuery or TTable. . . . . . . . . . . . . . .20-5
Creating decision datasets with the
Decision Query editor. . . . . . . . . . . . 20-6
Using decision cubes . . . . . . . . . . . . . . . 20-7
Decision cube properties and events . . . . 20-7
Using the Decision Cube editor . . . . . . . 20-7
Viewing and changing dimension
settings . . . . . . . . . . . . . . . . . . 20-8
Setting the maximum available
dimensions and summaries. . . . . . . 20-8
Viewing and changing design
options . . . . . . . . . . . . . . . . . . 20-8
Using decision sources . . . . . . . . . . . . . . 20-9
Properties and events . . . . . . . . . . . . . 20-9
Using decision pivots. . . . . . . . . . . . . . . 20-9
Decision pivot properties. . . . . . . . . . 20-10
Creating and using decision grids . . . . . . 20-10
Creating decision grids . . . . . . . . . . . 20-10
Using decision grids . . . . . . . . . . . . .20-11
Opening and closing decision
grid fields . . . . . . . . . . . . . . . . .20-11
Reorganizing rows and columns
in decision grids . . . . . . . . . . . . .20-11
Drilling down for detail in decision
grids . . . . . . . . . . . . . . . . . . . .20-11
Limiting dimension selection in
decision grids. . . . . . . . . . . . . . 20-12
Decision grid properties . . . . . . . . . . 20-12
Creating and using decision graphs . . . . . 20-13
Creating decision graphs . . . . . . . . . . 20-13
Using decision graphs . . . . . . . . . . . 20-13
The decision graph display. . . . . . . . . 20-15
Customizing decision graphs . . . . . . . 20-15
Setting decision graph template
defaults . . . . . . . . . . . . . . . . . 20-16
Customizing decision graph
series. . . . . . . . . . . . . . . . . . . 20-17
Decision support components at
runtime. . . . . . . . . . . . . . . . . . . . . 20-18
Decision pivots at runtime . . . . . . . . . 20-18
Decision grids at runtime. . . . . . . . . . 20-18
Decision graphs at runtime. . . . . . . . . 20-19
Decision support components and
memory control . . . . . . . . . . . . . . . . 20-19
Setting maximum dimensions,
summaries, and cells . . . . . . . . . . . 20-19
Setting dimension state . . . . . . . . . . . 20-20
Using paged dimensions . . . . . . . . . . 20-20
xi
Chapter 21
Connecting to databases 21-1
Using implicit connections . . . . . . . . . . . .21-2
Controlling connections. . . . . . . . . . . . . .21-2
Connecting to a database server . . . . . . .21-3
Disconnecting from a database server . . . .21-3
Controlling server login. . . . . . . . . . . . . .21-4
Managing transactions . . . . . . . . . . . . . .21-6
Starting a transaction . . . . . . . . . . . . .21-6
Ending a transaction . . . . . . . . . . . . . .21-8
Ending a successful transaction . . . . . .21-8
Ending an unsuccessful
transaction . . . . . . . . . . . . . . . . .21-8
Specifying the transaction isolation
level . . . . . . . . . . . . . . . . . . . . . .21-9
Sending commands to the server . . . . . . . 21-10
Working with associated datasets . . . . . . . 21-12
Closing all datasets without dis-
connecting from the server . . . . . . . . 21-12
Iterating through the associated
datasets . . . . . . . . . . . . . . . . . . . 21-12
Obtaining metadata . . . . . . . . . . . . . . . 21-13
Listing available tables. . . . . . . . . . . . 21-13
Listing the fields in a table . . . . . . . . . 21-13
Listing available stored procedures . . . . 21-14
Listing available indexes . . . . . . . . . . 21-14
Listing stored procedure parameters. . . . 21-14
Chapter 22
Understanding datasets 22-1
Using TDataSet descendants . . . . . . . . . . .22-2
Determining dataset states . . . . . . . . . . . .22-3
Opening and closing datasets . . . . . . . . . .22-4
Navigating datasets . . . . . . . . . . . . . . . .22-5
Using the First and Last methods . . . . . .22-6
Using the Next and Prior methods . . . . . .22-6
Using the MoveBy method . . . . . . . . . .22-7
Using the Eof and Bof properties. . . . . . .22-7
Eof . . . . . . . . . . . . . . . . . . . . . .22-7
Bof . . . . . . . . . . . . . . . . . . . . . .22-8
Marking and returning to records . . . . . .22-9
The Bookmark property . . . . . . . . . .22-9
The GetBookmark method. . . . . . . . .22-9
The GotoBookmark and Bookmark
Valid methods . . . . . . . . . . . . . . .22-9
The CompareBookmarks method. . . . .22-9
The FreeBookmark method . . . . . . . 22-10
A bookmarking example. . . . . . . . . 22-10
Searching datasets . . . . . . . . . . . . . . . . 22-10
Using Locate . . . . . . . . . . . . . . . . . 22-10
Using Lookup . . . . . . . . . . . . . . . . .22-11
Displaying and editing a subset of data
using filters . . . . . . . . . . . . . . . . . . 22-12
Enabling and disabling filtering . . . . . . 22-13
Creating filters. . . . . . . . . . . . . . . . 22-13
Setting the Filter property. . . . . . . . 22-14
Writing an OnFilterRecord event
handler . . . . . . . . . . . . . . . . . 22-15
Switching filter event handlers at
runtime . . . . . . . . . . . . . . . . . 22-15
Setting filter options. . . . . . . . . . . . . 22-15
Navigating records in a filtered
dataset . . . . . . . . . . . . . . . . . . . 22-16
Modifying data . . . . . . . . . . . . . . . . . 22-17
Editing records. . . . . . . . . . . . . . . . 22-17
Adding new records . . . . . . . . . . . . 22-18
Inserting records . . . . . . . . . . . . . 22-19
Appending records . . . . . . . . . . . 22-19
Deleting records . . . . . . . . . . . . . . . 22-19
Posting data . . . . . . . . . . . . . . . . . 22-20
Canceling changes. . . . . . . . . . . . . . 22-21
Modifying entire records . . . . . . . . . . 22-21
Calculating fields . . . . . . . . . . . . . . . . 22-22
Types of datasets . . . . . . . . . . . . . . . . 22-23
Using table type datasets. . . . . . . . . . . . 22-25
Advantages of using table type
datasets . . . . . . . . . . . . . . . . . . . 22-25
Sorting records with indexes. . . . . . . . 22-26
Obtaining information about
indexes . . . . . . . . . . . . . . . . . 22-26
Specifying an index with
IndexName . . . . . . . . . . . . . . . 22-26
Creating an index with IndexField-
Names. . . . . . . . . . . . . . . . . . 22-27
Using Indexes to search for
records . . . . . . . . . . . . . . . . . . . 22-27
Executing a search with Goto
methods. . . . . . . . . . . . . . . . . 22-28
Executing a search with Find
methods. . . . . . . . . . . . . . . . . 22-29
Specifying the current record after
a successful search . . . . . . . . . . . 22-29
Searching on partial keys . . . . . . . . 22-29
Repeating or extending a search . . . . 22-29
Limiting records with ranges . . . . . . . 22-30
Understanding the differences
between ranges and filters . . . . . . 22-30
Specifying ranges . . . . . . . . . . . . 22-30
xii
Modifying a range . . . . . . . . . . . . 22-33
Applying or canceling a range . . . . . 22-34
Creating master/detail relationships. . . . 22-34
Making the table a detail of another
dataset . . . . . . . . . . . . . . . . . . 22-34
Using nested detail tables . . . . . . . . 22-36
Controlling Read/write access to
tables. . . . . . . . . . . . . . . . . . . . . 22-37
Creating and deleting tables . . . . . . . . 22-37
Creating tables . . . . . . . . . . . . . . 22-37
Deleting tables . . . . . . . . . . . . . . 22-40
Emptying tables . . . . . . . . . . . . . . . 22-40
Synchronizing tables. . . . . . . . . . . . . 22-40
Using query-type datasets . . . . . . . . . . . 22-41
Specifying the query . . . . . . . . . . . . . 22-42
Specifying a query using the
SQL property . . . . . . . . . . . . . . 22-42
Specifying a query using the
CommandText property . . . . . . . . 22-43
Using parameters in queries . . . . . . . . 22-43
Supplying parameters at design
time. . . . . . . . . . . . . . . . . . . . 22-44
Supplying parameters at runtime. . . . 22-45
Establishing master/detail relationships
using parameters . . . . . . . . . . . . . . 22-46
Preparing queries. . . . . . . . . . . . . . . 22-47
Executing queries that don’t return a
result set . . . . . . . . . . . . . . . . . . . 22-47
Using unidirectional result sets. . . . . . . 22-48
Using stored procedure-type datasets . . . . . 22-48
Working with stored procedure
parameters. . . . . . . . . . . . . . . . . . 22-50
Setting up parameters at design
time. . . . . . . . . . . . . . . . . . . . 22-50
Using parameters at runtime . . . . . . 22-52
Preparing stored procedures . . . . . . . . 22-52
Executing stored procedures that don’t
return a result set . . . . . . . . . . . . . . 22-53
Fetching multiple result sets . . . . . . . . 22-53
Chapter 23
Working with field components 23-1
Dynamic field components . . . . . . . . . . . .23-2
Persistent field components . . . . . . . . . . .23-3
Creating persistent fields . . . . . . . . . . .23-4
Arranging persistent fields . . . . . . . . . .23-5
Defining new persistent fields . . . . . . . .23-5
Defining a data field . . . . . . . . . . . .23-6
Defining a calculated field. . . . . . . . .23-7
Programming a calculated field . . . . . 23-7
Defining a lookup field . . . . . . . . . . 23-8
Defining an aggregate field. . . . . . . 23-10
Deleting persistent field
components . . . . . . . . . . . . . . . . 23-10
Setting persistent field properties
and events . . . . . . . . . . . . . . . . . 23-10
Setting display and edit properties
at design time. . . . . . . . . . . . . . .23-11
Setting field component properties
at runtime. . . . . . . . . . . . . . . . 23-12
Creating attribute sets for field
components. . . . . . . . . . . . . . . 23-12
Associating attribute sets with field
components. . . . . . . . . . . . . . . 23-13
Removing attribute associations . . . . 23-14
Controlling and masking user
input. . . . . . . . . . . . . . . . . . . 23-14
Using default formatting for numeric,
date, and time fields . . . . . . . . . . 23-14
Handling events . . . . . . . . . . . . . 23-15
Working with field component methods
at runtime . . . . . . . . . . . . . . . . . . . 23-16
Displaying, converting, and accessing
field values. . . . . . . . . . . . . . . . . . . 23-17
Displaying field component values
in standard controls . . . . . . . . . . . . 23-17
Converting field values. . . . . . . . . . . 23-17
Accessing field values with the default
dataset property . . . . . . . . . . . . . . 23-19
Accessing field values with a dataset’s
Fields property. . . . . . . . . . . . . . . 23-19
Accessing field values with a dataset’s
FieldByName method. . . . . . . . . . . 23-20
Setting a default value for a field . . . . . . . 23-20
Working with constraints . . . . . . . . . . . 23-21
Creating a custom constraint. . . . . . . . 23-21
Using server constraints . . . . . . . . . . 23-21
Using object fields . . . . . . . . . . . . . . . 23-22
Displaying ADT and array fields . . . . . 23-23
Working with ADT fields. . . . . . . . . . 23-23
Using persistent field
components. . . . . . . . . . . . . . . 23-24
Using the dataset’s FieldByName
method . . . . . . . . . . . . . . . . . 23-24
Using the dateset’s FieldValues
property. . . . . . . . . . . . . . . . . 23-24
Using the ADT field’s FieldValues
property. . . . . . . . . . . . . . . . . 23-24
xiii
Using the ADT field’s Fields
property . . . . . . . . . . . . . . . . . 23-24
Working with array fields . . . . . . . . . . 23-25
Using persistent fields . . . . . . . . . . 23-25
Using the array field’s FieldValues
property . . . . . . . . . . . . . . . . . 23-25
Using the array field’s Fields
property . . . . . . . . . . . . . . . . . 23-25
Working with dataset fields . . . . . . . . . 23-25
Displaying dataset fields. . . . . . . . . 23-26
Accessing data in a nested
dataset . . . . . . . . . . . . . . . . . . 23-26
Working with reference fields. . . . . . . . 23-26
Displaying reference fields . . . . . . . 23-26
Accessing data in a reference
field. . . . . . . . . . . . . . . . . . . . 23-27
Chapter 24
Using the Borland Database
Engine 24-1
BDE-based architecture . . . . . . . . . . . . . .24-1
Using BDE-enabled datasets . . . . . . . . .24-2
Associating a dataset with database
and session connections . . . . . . . . .24-3
Caching BLOBs . . . . . . . . . . . . . . .24-4
Obtaining a BDE handle . . . . . . . . . .24-4
Using TTable . . . . . . . . . . . . . . . . . .24-4
Specifying the table type for local
tables . . . . . . . . . . . . . . . . . . . .24-5
Controlling read/write access to
local tables . . . . . . . . . . . . . . . . .24-6
Specifying a dBASE index file. . . . . . .24-6
Renaming local tables . . . . . . . . . . .24-7
Importing data from another table . . . .24-7
Using TQuery. . . . . . . . . . . . . . . . . .24-8
Creating heterogeneous queries. . . . . .24-9
Obtaining an editable result set . . . . . 24-10
Updating read-only result sets . . . . . 24-11
Using TStoredProc . . . . . . . . . . . . . . 24-11
Binding parameters. . . . . . . . . . . . 24-11
Working with Oracle overloaded
stored procedures . . . . . . . . . . . . 24-12
Connecting to databases with
TDatabase . . . . . . . . . . . . . . . . . . 24-12
Associating a database component
with a session . . . . . . . . . . . . . . 24-12
Understanding database and session
component interactions . . . . . . . . 24-13
Identifying the database . . . . . . . . . 24-13
Opening a connection using
TDatabase. . . . . . . . . . . . . . . . 24-15
Using database components in data
modules. . . . . . . . . . . . . . . . . 24-16
Managing database sessions . . . . . . . . 24-16
Activating a session . . . . . . . . . . . 24-17
Specifying default database
connection behavior . . . . . . . . . . 24-18
Managing database connections . . . . 24-19
Working with password-protected
Paradox and dBASE tables . . . . . . 24-21
Specifying Paradox directory
locations. . . . . . . . . . . . . . . . . 24-23
Working with BDE aliases . . . . . . . 24-24
Retrieving information about a
session. . . . . . . . . . . . . . . . . . 24-26
Creating additional sessions . . . . . . 24-26
Naming a session . . . . . . . . . . . . 24-27
Managing multiple sessions . . . . . . 24-28
Using transactions with the BDE . . . . . . . 24-29
Using passthrough SQL . . . . . . . . . . 24-30
Using local transactions . . . . . . . . . . 24-31
Using the BDE to cache updates . . . . . . . 24-31
Enabling BDE-based cached
updates . . . . . . . . . . . . . . . . . . . 24-33
Applying BDE-based cached
updates . . . . . . . . . . . . . . . . . . . 24-33
Applying cached updates using
a database. . . . . . . . . . . . . . . . 24-34
Applying cached updates with
dataset component methods . . . . . 24-35
Creating an OnUpdateRecord
event handler. . . . . . . . . . . . . . 24-35
Handling cached update errors . . . . 24-37
Using update objects to update a
dataset . . . . . . . . . . . . . . . . . . . 24-39
Creating SQL statements for
update components . . . . . . . . . . 24-40
Using multiple update objects . . . . . 24-43
Executing the SQL statements . . . . . 24-44
Using TBatchMove . . . . . . . . . . . . . . . 24-47
Creating a batch move component . . . . 24-47
Specifying a batch move mode . . . . . . 24-48
Appending records . . . . . . . . . . . 24-48
Updating records . . . . . . . . . . . . 24-49
Appending and updating
records. . . . . . . . . . . . . . . . . . 24-49
Copying datasets. . . . . . . . . . . . . 24-49
Deleting records . . . . . . . . . . . . . 24-49
xiv
Mapping data types . . . . . . . . . . . . . 24-49
Executing a batch move . . . . . . . . . . . 24-50
Handling batch move errors . . . . . . . . 24-51
The Data Dictionary . . . . . . . . . . . . . . . 24-51
Tools for working with the BDE . . . . . . . . 24-53
Chapter 25
Working with ADO components 25-1
Overview of ADO components . . . . . . . . .25-1
Connecting to ADO data stores . . . . . . . . .25-2
Connecting to a data store using
TADOConnection. . . . . . . . . . . . . . .25-3
Accessing the connection object. . . . . .25-4
Fine-tuning a connection . . . . . . . . . . .25-4
Forcing asynchronous connections . . . .25-5
Controlling time-outs. . . . . . . . . . . .25-5
Indicating the types of operations
the connection supports . . . . . . . . .25-5
Specifying whether the connection
automatically initiates transactions . . .25-6
Accessing the connection’s commands . . .25-7
ADO connection events . . . . . . . . . . . .25-7
Events when establishing a
connection . . . . . . . . . . . . . . . . .25-7
Events when disconnecting . . . . . . . .25-7
Events when managing
transactions . . . . . . . . . . . . . . . .25-8
Other events. . . . . . . . . . . . . . . . .25-8
Using ADO datasets. . . . . . . . . . . . . . . .25-8
Connecting an ADO dataset to
a data store . . . . . . . . . . . . . . . .25-9
Working with record sets . . . . . . . . 25-10
Filtering records based on
bookmarks . . . . . . . . . . . . . . . . 25-10
Fetching records
asynchronously . . . . . . . . . . . . . 25-11
Using batch updates . . . . . . . . . . . 25-11
Loading data from and saving
data to files. . . . . . . . . . . . . . . . 25-14
Using TADODataSet . . . . . . . . . . . . . 25-15
Using Command objects . . . . . . . . . . . . 25-16
Specifying the command . . . . . . . . . . 25-17
Using the Execute method. . . . . . . . . . 25-17
Canceling commands . . . . . . . . . . . . 25-17
Retrieving result sets with
commands. . . . . . . . . . . . . . . . . . 25-18
Handling command parameters . . . . . . 25-18
Chapter 26
Using unidirectional datasets 26-1
Types of unidirectional datasets. . . . . . . . . 26-2
Connecting to the database server . . . . . . . 26-2
Setting up TSQLConnection . . . . . . . . . 26-3
Identifying the driver . . . . . . . . . . . 26-3
Specifying connection parameters . . . . 26-4
Naming a connection description . . . . 26-4
Using the Connection Editor . . . . . . . 26-5
Specifying what data to display. . . . . . . . . 26-5
Representing the results of a query . . . . . 26-6
Representing the records in a table . . . . . 26-6
Representing a table using
TSQLDataSet . . . . . . . . . . . . . . . 26-6
Representing a table using
TSQLTable . . . . . . . . . . . . . . . . 26-7
Representing the results of a stored
procedure. . . . . . . . . . . . . . . . . . . 26-7
Fetching the data . . . . . . . . . . . . . . . . . 26-8
Preparing the dataset . . . . . . . . . . . . . 26-8
Fetching multiple datasets . . . . . . . . . . 26-9
Executing commands that do not
return records . . . . . . . . . . . . . . . . . . 26-9
Specifying the command to
execute . . . . . . . . . . . . . . . . . . . . 26-9
Executing the command . . . . . . . . . . 26-10
Creating and modifying server
metadata . . . . . . . . . . . . . . . . . . 26-10
Setting up master/detail linked
cursors . . . . . . . . . . . . . . . . . . . . . .26-11
Accessing schema information . . . . . . . . 26-12
Fetching metadata into a unidirectional
dataset . . . . . . . . . . . . . . . . . . . 26-12
Fetching data after using the
dataset for metadata . . . . . . . . . . 26-13
The structure of metadata
datasets . . . . . . . . . . . . . . . . . 26-13
Debugging dbExpress applications. . . . . . 26-17
Using TSQLMonitor to monitor
SQL commands . . . . . . . . . . . . . . 26-17
Using a callback to monitor
SQL commands . . . . . . . . . . . . . . 26-18
Chapter 27
Using client datasets 27-1
Working with data using a client
dataset . . . . . . . . . . . . . . . . . . . . . . 27-2
Navigating data in client datasets . . . . . . 27-2
xv
Limiting what records appear. . . . . . . . .27-2
Editing data . . . . . . . . . . . . . . . . . . .27-5
Undoing changes . . . . . . . . . . . . . .27-5
Saving changes . . . . . . . . . . . . . . .27-6
Constraining data values . . . . . . . . . . .27-6
Specifying custom constraints. . . . . . .27-7
Sorting and indexing. . . . . . . . . . . . . .27-7
Adding a new index . . . . . . . . . . . .27-8
Deleting and switching indexes. . . . . .27-9
Using indexes to group data. . . . . . . .27-9
Representing calculated values . . . . . . . 27-10
Using internally calculated fields
in client datasets. . . . . . . . . . . . . 27-10
Using maintained aggregates . . . . . . . . 27-11
Specifying aggregates . . . . . . . . . . 27-11
Aggregating over groups of
records . . . . . . . . . . . . . . . . . . 27-12
Obtaining aggregate values . . . . . . . 27-13
Copying data from another dataset . . . . 27-13
Assigning data directly. . . . . . . . . . 27-14
Cloning a client dataset cursor . . . . . 27-14
Adding application-specific information
to the data . . . . . . . . . . . . . . . . . . 27-15
Using a client dataset to cache updates . . . . 27-15
Overview of using cached updates. . . . . 27-16
Choosing the type of dataset for
caching updates. . . . . . . . . . . . . . . 27-17
Indicating what records are
modified . . . . . . . . . . . . . . . . . . . 27-18
Updating records. . . . . . . . . . . . . . . 27-19
Applying updates. . . . . . . . . . . . . 27-20
Intervening as updates are
applied . . . . . . . . . . . . . . . . . . 27-21
Reconciling update errors . . . . . . . . 27-22
Using a client dataset with a provider. . . . . 27-24
Specifying a provider . . . . . . . . . . . . 27-24
Requesting data from the source
dataset or document . . . . . . . . . . . . 27-25
Incremental fetching . . . . . . . . . . . 27-25
Fetch-on-demand . . . . . . . . . . . . . 27-26
Getting parameters from the source
dataset . . . . . . . . . . . . . . . . . . . . 27-26
Passing parameters to the source
dataset . . . . . . . . . . . . . . . . . . . . 27-27
Sending query or stored procedure
parameters. . . . . . . . . . . . . . . . 27-28
Limiting records with parameters . . . 27-28
Handling constraints from the server . . . 27-29
Refreshing records . . . . . . . . . . . . . . 27-30
Communicating with providers using
custom events . . . . . . . . . . . . . . . 27-30
Overriding the source dataset . . . . . . . 27-31
Using a client dataset with file-based
data . . . . . . . . . . . . . . . . . . . . . . . 27-32
Creating a new dataset . . . . . . . . . . . 27-32
Loading data from a file or stream . . . . 27-33
Merging changes into data . . . . . . . . . 27-33
Saving data to a file or stream . . . . . . . 27-34
Chapter 28
Using provider components 28-1
Determining the source of data . . . . . . . . . 28-2
Using a dataset as the source of the
data . . . . . . . . . . . . . . . . . . . . . . 28-2
Using an XML document as the
source of the data . . . . . . . . . . . . . . 28-2
Communicating with the client dataset . . . . 28-3
Choosing how to apply updates using
a dataset provider. . . . . . . . . . . . . . . . 28-4
Controlling what information is included
in data packets. . . . . . . . . . . . . . . . . . 28-4
Specifying what fields appear in data
packets . . . . . . . . . . . . . . . . . . . . 28-4
Setting options that influence the data
packets . . . . . . . . . . . . . . . . . . . . 28-5
Adding custom information to data
packets . . . . . . . . . . . . . . . . . . . . 28-6
Responding to client data requests . . . . . . . 28-7
Responding to client update requests . . . . . 28-8
Editing delta packets before updating
the database . . . . . . . . . . . . . . . . . 28-9
Influencing how updates are
applied . . . . . . . . . . . . . . . . . . . . 28-9
Screening individual updates . . . . . . . .28-11
Resolving update errors on the
provider. . . . . . . . . . . . . . . . . . . .28-11
Applying updates to datasets that
do not represent a single table . . . . . . .28-11
Responding to client-generated
events. . . . . . . . . . . . . . . . . . . . . . 28-12
Handling server constraints . . . . . . . . . . 28-12
Chapter 29
Creating multi-tiered applications 29-1
Advantages of the multi-tiered database
model. . . . . . . . . . . . . . . . . . . . . . . 29-2
Understanding provider-based multi-
tiered applications . . . . . . . . . . . . . . . 29-2
xvi
Overview of a three-tiered
application. . . . . . . . . . . . . . . . . . .29-3
The structure of the client
application. . . . . . . . . . . . . . . . . . .29-4
The structure of the application
server. . . . . . . . . . . . . . . . . . . . . .29-5
The contents of the remote data
module . . . . . . . . . . . . . . . . . . .29-6
Using transactional data
modules . . . . . . . . . . . . . . . . . .29-6
Pooling remote data modules . . . . . . .29-8
Choosing a connection protocol . . . . . . .29-9
Using DCOM connections . . . . . . . . .29-9
Using Socket connections . . . . . . . . .29-9
Using Web connections. . . . . . . . . . 29-10
Using SOAP connections. . . . . . . . . 29-11
Building a multi-tiered application . . . . . . 29-11
Creating the application server. . . . . . . . . 29-12
Setting up the remote data module. . . . . 29-13
Configuring the remote data module
when it is not transactional . . . . . . 29-13
Configuring a transactional remote
data module . . . . . . . . . . . . . . . 29-14
Configuring TSoapDataModule. . . . . 29-15
Extending the application server’s
interface . . . . . . . . . . . . . . . . . . . 29-16
Adding callbacks to the application
server’s interface . . . . . . . . . . . . 29-17
Extending a transactional application
server’s interface . . . . . . . . . . . . 29-17
Managing transactions in multi-tiered
applications . . . . . . . . . . . . . . . . . 29-17
Supporting master/detail
relationships. . . . . . . . . . . . . . . . . 29-18
Supporting state information in
remote data modules. . . . . . . . . . . . 29-19
Using multiple remote data
modules . . . . . . . . . . . . . . . . . . . 29-20
Registering the application server . . . . . . . 29-21
Creating the client application . . . . . . . . . 29-21
Connecting to the application
server. . . . . . . . . . . . . . . . . . . . . 29-22
Specifying a connection using
DCOM . . . . . . . . . . . . . . . . . . 29-23
Specifying a connection using
sockets . . . . . . . . . . . . . . . . . . 29-23
Specifying a connection using
HTTP . . . . . . . . . . . . . . . . . . . 29-24
Specifying a connection using
SOAP . . . . . . . . . . . . . . . . . . 29-25
Brokering connections . . . . . . . . . 29-25
Managing server connections . . . . . . . 29-26
Connecting to the server . . . . . . . . 29-26
Dropping or changing a server
onnection . . . . . . . . . . . . . . . . 29-26
Calling server interfaces . . . . . . . . . . 29-27
Connecting to an application server
that uses multiple data modules. . . . . 29-28
Writing Web-based client applications . . . . 29-28
Distributing a client application as an
ActiveX control . . . . . . . . . . . . . . 29-30
Creating an Active Form for the
client application. . . . . . . . . . . . 29-30
Building Web applications using
InternetExpress . . . . . . . . . . . . . . 29-31
Building an InternetExpress
application . . . . . . . . . . . . . . . . . 29-31
Using the javascript libraries . . . . . . 29-33
Granting permission to access and
launch the application server. . . . . 29-33
Using an XML broker. . . . . . . . . . . . 29-34
Fetching XML data packets. . . . . . . 29-34
Applying updates from XML delta
packets . . . . . . . . . . . . . . . . . 29-35
Creating Web pages with an Internet-
Express page producer . . . . . . . . . . 29-36
Using the Web page editor . . . . . . . 29-37
Setting Web item properties . . . . . . 29-37
Customizing the InternetExpress
page producer template . . . . . . . . 29-38
Chapter 30
Using XML in database applications30-1
Defining transformations . . . . . . . . . . . . 30-1
Mapping between XML nodes and
data packet fields . . . . . . . . . . . . . . 30-2
Using XMLMapper . . . . . . . . . . . . . . 30-4
Loading an XML schema or data
packet . . . . . . . . . . . . . . . . . . . 30-4
Defining mappings . . . . . . . . . . . . 30-4
Generating transformation files . . . . . 30-5
Converting XML documents into data
packets . . . . . . . . . . . . . . . . . . . . . . 30-6
Specifying the source XML
document. . . . . . . . . . . . . . . . . . . 30-6
Specifying the transformation . . . . . . . . 30-7
Obtaining the resulting data packet. . . . . 30-7
xvii
Converting user-defined nodes. . . . . . . .30-7
Using an XML document as the source
for a provider. . . . . . . . . . . . . . . . . . .30-8
Using an XML document as the client of
a provider . . . . . . . . . . . . . . . . . . . . .30-9
Fetching an XML document from
a provider . . . . . . . . . . . . . . . . . . .30-9
Applying updates from an XML
document to a provider . . . . . . . . . . 30-10
Part III
Writing Internet applications
Chapter 31
Writing CORBA applications 31-1
Overview of a CORBA application . . . . . . .31-1
Understanding stubs and skeletons . . . . .31-2
Using Smart Agent. . . . . . . . . . . . . . .31-3
Activating server applications . . . . . . . .31-3
Binding interface calls dynamically . . . . .31-4
Writing CORBA servers. . . . . . . . . . . . . .31-4
Defining object interfaces . . . . . . . . . . .31-5
Using the CORBA Server Wizard. . . . . . .31-5
Generating stubs and skeletons from
an IDL file . . . . . . . . . . . . . . . . . . .31-6
Using the CORBA Object Implementa-
tion Wizard . . . . . . . . . . . . . . . . . .31-6
Instantiating CORBA objects . . . . . . .31-7
Using the delegation model . . . . . . . .31-8
Viewing and editing changes . . . . . . .31-9
Implementing CORBA Objects . . . . . . . .31-9
Guarding against thread
conflicts . . . . . . . . . . . . . . . . . 31-11
Changing CORBA interfaces . . . . . . . . 31-12
Registering server interfaces . . . . . . . . 31-12
Writing CORBA clients . . . . . . . . . . . . . 31-13
Using stubs . . . . . . . . . . . . . . . . . . 31-14
Using the dynamic invocation
interface . . . . . . . . . . . . . . . . . . . 31-15
Testing CORBA servers . . . . . . . . . . . . . 31-16
Setting up the testing tool . . . . . . . . . . 31-16
Recording and running test scripts. . . . . 31-17
Chapter 32
Creating Internet server
applications 32-1
About Web Broker and WebSnap . . . . . . . .32-1
Terminology and standards. . . . . . . . . . . .32-3
Parts of a Uniform Resource Locator . . . . 32-3
URI vs. URL . . . . . . . . . . . . . . . . 32-4
HTTP request header information. . . . . . 32-4
HTTP server activity . . . . . . . . . . . . . . . 32-5
Composing client requests . . . . . . . . . . 32-5
Serving client requests . . . . . . . . . . . . 32-5
Responding to client requests . . . . . . . . 32-6
Types of Web server applications . . . . . . . . 32-6
ISAPI and NSAPI . . . . . . . . . . . . . 32-6
CGI stand-alone . . . . . . . . . . . . . . 32-7
Win-CGI stand-alone . . . . . . . . . . . 32-7
Apache . . . . . . . . . . . . . . . . . . . 32-7
Web App Debugger . . . . . . . . . . . . 32-7
Converting Web server application
target types. . . . . . . . . . . . . . . . . . 32-8
Debugging server applications . . . . . . . . . 32-9
Using the Web Application
Debugger . . . . . . . . . . . . . . . . . . . 32-9
Launching your application with
the Web Application Debugger. . . . . 32-9
Converting your application to
another type of Web server
application . . . . . . . . . . . . . . . 32-10
Debugging Web applications that
are DLLs . . . . . . . . . . . . . . . . . . 32-10
User rights necessary for DLL
debugging. . . . . . . . . . . . . . . . .32-11
Chapter 33
Using Web Broker 33-1
Creating Web server applications with
Web Broker. . . . . . . . . . . . . . . . . . . . 33-1
The Web module. . . . . . . . . . . . . . . . 33-2
The Web Application object . . . . . . . . . 33-3
The structure of a Web Broker
application . . . . . . . . . . . . . . . . . . . . 33-3
The Web dispatcher. . . . . . . . . . . . . . . . 33-4
Adding actions to the dispatcher . . . . . . 33-4
Dispatching request messages . . . . . . . . 33-5
Action items . . . . . . . . . . . . . . . . . . . . 33-5
Determining when action items fire. . . . . 33-6
The target URL. . . . . . . . . . . . . . . 33-6
The request method type . . . . . . . . . 33-6
Enabling and disabling action
items. . . . . . . . . . . . . . . . . . . . 33-6
Choosing a default action item. . . . . . 33-7
Responding to request messages
with action items . . . . . . . . . . . . . . 33-7
Sending the response . . . . . . . . . . . 33-8
xviii
Using multiple action items . . . . . . . .33-8
Accessing client request information . . . . . .33-8
Properties that contain request
header information. . . . . . . . . . . . . .33-9
Properties that identify the target. . . . .33-9
Properties that describe the Web
client . . . . . . . . . . . . . . . . . . . .33-9
Properties that identify the purpose
of the request . . . . . . . . . . . . . . .33-9
Properties that describe the expected
response . . . . . . . . . . . . . . . . . 33-10
Properties that describe the
content . . . . . . . . . . . . . . . . . . 33-10
The content of HTTP request
messages. . . . . . . . . . . . . . . . . . . 33-10
Creating HTTP response messages . . . . . . 33-10
Filling in the response header. . . . . . . . 33-11
Indicating the response status. . . . . . 33-11
Indicating the need for client
action . . . . . . . . . . . . . . . . . . . 33-11
Describing the server application. . . . 33-12
Describing the content . . . . . . . . . . 33-12
Setting the response content . . . . . . . . 33-12
Sending the response . . . . . . . . . . . . 33-12
Generating the content of response
messages . . . . . . . . . . . . . . . . . . . . 33-13
Using page producer components . . . . . 33-13
HTML templates . . . . . . . . . . . . . 33-13
Specifying the HTML template . . . . . 33-14
Converting HTML-transparent
tags . . . . . . . . . . . . . . . . . . . . 33-15
Using page producers from an
action item . . . . . . . . . . . . . . . . 33-15
Chaining page producers
together . . . . . . . . . . . . . . . . . 33-16
Using database information in
responses . . . . . . . . . . . . . . . . . . . . 33-17
Adding a session to the Web
module. . . . . . . . . . . . . . . . . . . . 33-17
Representing database information
in HTML. . . . . . . . . . . . . . . . . . . 33-18
Using dataset page producers. . . . . . 33-18
Using table producers . . . . . . . . . . 33-18
Specifying the table attributes. . . . . . 33-18
Specifying the row attributes . . . . . . 33-19
Specifying the columns. . . . . . . . . . 33-19
Embedding tables in HTML
documents . . . . . . . . . . . . . . . . 33-19
Setting up a dataset table
producer . . . . . . . . . . . . . . . . 33-20
Setting up a query table
producer . . . . . . . . . . . . . . . . 33-20
Chapter 34
Creating Web Server applications
using WebSnap 34-1
Fundamental WebSnap components . . . . . . 34-2
Web modules. . . . . . . . . . . . . . . . . . 34-2
Web application module types . . . . . . 34-3
Web page modules. . . . . . . . . . . . . 34-4
Web data modules . . . . . . . . . . . . . 34-4
Adapters . . . . . . . . . . . . . . . . . . . . 34-5
Fields . . . . . . . . . . . . . . . . . . . . 34-5
Actions . . . . . . . . . . . . . . . . . . . 34-6
Errors . . . . . . . . . . . . . . . . . . . . 34-6
Records . . . . . . . . . . . . . . . . . . . 34-6
Page producers . . . . . . . . . . . . . . . . 34-6
Creating Web server applications with
WebSnap . . . . . . . . . . . . . . . . . . . . . 34-7
Selecting a server type . . . . . . . . . . . . 34-8
Specifying application module
components . . . . . . . . . . . . . . . . . 34-8
Selecting Web application module
options . . . . . . . . . . . . . . . . . . . 34-10
WebSnap tutorial . . . . . . . . . . . . . . . . .34-11
Create a new application . . . . . . . . . . .34-11
Step 1. Start the WebSnap application
wizard. . . . . . . . . . . . . . . . . . .34-11
Step 2. Save the generated files and
project . . . . . . . . . . . . . . . . . . .34-11
Step 3. Specify the application
title. . . . . . . . . . . . . . . . . . . . 34-12
Create a CountryTable page . . . . . . . . 34-12
Step 1. Add a new Web page
module . . . . . . . . . . . . . . . . . 34-12
Step 2. Save the new Web page
module . . . . . . . . . . . . . . . . . 34-13
Add data components to the Country-
Table module. . . . . . . . . . . . . . . . 34-13
Step 1. Add data-aware
components. . . . . . . . . . . . . . . 34-13
Step 2. Specify a key field. . . . . . . . 34-14
Step 3. Add an adapter
component . . . . . . . . . . . . . . . 34-14
Create a grid to display the data. . . . . . 34-15
Step 1. Add a grid . . . . . . . . . . . . 34-15
xix
Step 2. Add editing commands to
the grid. . . . . . . . . . . . . . . . . . 34-17
Add an edit form . . . . . . . . . . . . . . . 34-18
Step 1. Add a new Web page
module . . . . . . . . . . . . . . . . . . 34-18
Step 2. Save the new module . . . . . . 34-18
Step 3. Make CountryTableU
accessible to the new module . . . . . 34-18
Step 4. Add input fields . . . . . . . . . 34-18
Step 5. Add buttons. . . . . . . . . . . . 34-19
Step 6. Link form actions to the
grid page. . . . . . . . . . . . . . . . . 34-20
Step 7. Link grid actions to the
form page . . . . . . . . . . . . . . . . 34-20
Run the completed application . . . . . . . 34-21
Add error reporting . . . . . . . . . . . . . 34-21
Step 1. Add error support to
the grid. . . . . . . . . . . . . . . . . . 34-21
Step 2. Add error support to
the form . . . . . . . . . . . . . . . . . 34-22
Step 3. Test the error-reporting
mechanism. . . . . . . . . . . . . . . . 34-22
Advanced HTML design . . . . . . . . . . . . 34-23
Manipulating server-side script
in HTML files . . . . . . . . . . . . . . . . 34-24
Login support . . . . . . . . . . . . . . . . . . 34-24
Adding login support . . . . . . . . . . . . 34-25
Using the sessions service . . . . . . . . . . 34-26
Login pages . . . . . . . . . . . . . . . . . . 34-26
Setting pages to require logins . . . . . . . 34-28
User access rights. . . . . . . . . . . . . . . 34-28
Dynamically displaying fields as
edit or text boxes . . . . . . . . . . . . 34-29
Hiding fields and their contents. . . . . 34-30
Preventing page access. . . . . . . . . . 34-30
Server-side scripting in WebSnap . . . . . . . 34-30
Active scripting. . . . . . . . . . . . . . . . 34-31
Script engine . . . . . . . . . . . . . . . . . 34-31
Script blocks. . . . . . . . . . . . . . . . . . 34-31
Creating script . . . . . . . . . . . . . . . . 34-32
Wizard templates . . . . . . . . . . . . . 34-32
TAdapterPageProducer . . . . . . . . . 34-32
Editing and viewing script . . . . . . . . . 34-32
Including script in a page . . . . . . . . . . 34-32
Script objects . . . . . . . . . . . . . . . . . 34-32
Dispatching requests and responses. . . . . . 34-33
Dispatcher components . . . . . . . . . . . 34-34
Adapter dispatcher operation. . . . . . . . 34-34
Using adapter components to
generate content . . . . . . . . . . . . 34-34
Receiving adapter requests and
generating responses . . . . . . . . . 34-35
Image request . . . . . . . . . . . . . . 34-37
Image response. . . . . . . . . . . . . . 34-37
Dispatching action items . . . . . . . . . . 34-38
Page dispatcher operation . . . . . . . . . 34-38
Chapter 35
Working with XML documents 35-1
Using the Document Object Model . . . . . . . 35-2
Working with XML components . . . . . . . . 35-3
Using TXMLDocument. . . . . . . . . . . . 35-3
Working with XML nodes . . . . . . . . . . 35-4
Working with a node’s value . . . . . . . 35-4
Working with a node’s attributes . . . . 35-5
Adding and deleting child nodes . . . . 35-5
Abstracting XML documents with the
Data Binding wizard . . . . . . . . . . . . . . 35-5
Using the XML Data Binding wizard . . . . 35-7
Using code that the XML Data
Binding wizard generates. . . . . . . . . . 35-8
Chapter 36
Using Web Services 36-1
Understanding invokable interfaces . . . . . . 36-2
Using nonscalar types in invokable
interfaces . . . . . . . . . . . . . . . . . . . 36-3
Registering nonscalar types. . . . . . . . 36-4
Registering typedef’ed types and
enumerated types . . . . . . . . . . . . 36-6
Using remotable objects. . . . . . . . . . 36-7
Remotable object example . . . . . . . . 36-8
Writing servers that support Web
Services. . . . . . . . . . . . . . . . . . . . . . 36-9
Building a Web Service server . . . . . . . 36-10
Using the SOAP application wizard . . . .36-11
Adding new Web Services . . . . . . . . . 36-12
Editing the generated code . . . . . . . 36-12
Using a different base class . . . . . . . 36-12
Using the Web Services Importer . . . . . 36-13
Creating custom exception classes
for Web Services . . . . . . . . . . . . . . 36-14
Generating WSDL documents for a
Web Service application. . . . . . . . . . 36-15
Writing clients for Web Services. . . . . . . . 36-16
Importing WSDL documents . . . . . . . 36-16
Calling invokable interfaces . . . . . . . . 36-16
xx
Chapter 37
Working with sockets 37-1
Implementing services . . . . . . . . . . . . . .37-1
Understanding service protocols . . . . . . .37-2
Communicating with applications . . . .37-2
Services and ports . . . . . . . . . . . . . . .37-2
Types of socket connections. . . . . . . . . . . .37-2
Client connections . . . . . . . . . . . . . . .37-3
Listening connections . . . . . . . . . . . . .37-3
Server connections . . . . . . . . . . . . . . .37-3
Describing sockets . . . . . . . . . . . . . . . . .37-3
Describing the host. . . . . . . . . . . . . . .37-4
Choosing between a host name
and an IP address . . . . . . . . . . . . .37-4
Using ports . . . . . . . . . . . . . . . . . . .37-5
Using socket components. . . . . . . . . . . . .37-5
Getting information about the
connection. . . . . . . . . . . . . . . . . . .37-6
Using client sockets . . . . . . . . . . . . . .37-6
Specifying the desired server . . . . . . .37-6
Forming the connection . . . . . . . . . .37-6
Getting information about the
connection . . . . . . . . . . . . . . . . .37-6
Closing the connection . . . . . . . . . . .37-7
Using server sockets . . . . . . . . . . . . . .37-7
Specifying the port . . . . . . . . . . . . .37-7
Listening for client requests . . . . . . . .37-7
Connecting to clients . . . . . . . . . . . .37-7
Closing server connections . . . . . . . .37-7
Responding to socket events . . . . . . . . . . .37-8
Error events . . . . . . . . . . . . . . . . . . .37-8
Client events . . . . . . . . . . . . . . . . . .37-8
Server events . . . . . . . . . . . . . . . . . .37-9
Events when listening . . . . . . . . . . .37-9
Events with client connections . . . . . .37-9
Reading and writing over socket
connections . . . . . . . . . . . . . . . . . . . .37-9
Non-blocking connections. . . . . . . . . . 37-10
Reading and writing events . . . . . . . 37-10
Blocking connections. . . . . . . . . . . . . 37-10
Part IV
Developing COM-based applications
Chapter 38
Overview of COM technologies 38-1
COM as a specification and
implementation . . . . . . . . . . . . . .38-1
COM extensions . . . . . . . . . . . . . . 38-2
Parts of a COM application . . . . . . . . . . . 38-2
COM interfaces . . . . . . . . . . . . . . . . 38-3
The fundamental COM interface,
IUnknown . . . . . . . . . . . . . . . . 38-4
COM interface pointers . . . . . . . . . . 38-4
COM servers. . . . . . . . . . . . . . . . . . 38-5
CoClasses and class factories. . . . . . . 38-6
In-process, out-of-process, and
remote servers . . . . . . . . . . . . . . 38-6
The marshaling mechanism . . . . . . . 38-8
Aggregation . . . . . . . . . . . . . . . . 38-9
COM clients . . . . . . . . . . . . . . . . . . 38-9
COM extensions. . . . . . . . . . . . . . . . . 38-10
Automation servers . . . . . . . . . . . . . 38-12
Active Server Pages . . . . . . . . . . . . . 38-13
ActiveX controls. . . . . . . . . . . . . . . 38-13
Active Documents. . . . . . . . . . . . . . 38-14
Transactional objects . . . . . . . . . . . . 38-14
COM Event and event subscriber
objects. . . . . . . . . . . . . . . . . . . . 38-15
Type libraries. . . . . . . . . . . . . . . . . 38-16
The content of type libraries . . . . . . 38-16
Creating type libraries. . . . . . . . . . 38-17
When to use type libraries . . . . . . . 38-17
Accessing type libraries. . . . . . . . . 38-17
Benefits of using type libraries . . . . . 38-18
Using type library tools . . . . . . . . . 38-18
Implementing COM objects with
wizards. . . . . . . . . . . . . . . . . . . . . 38-19
Code generated by wizards . . . . . . . . 38-22
Chapter 39
Working with type libraries 39-1
Type Library editor . . . . . . . . . . . . . . . . 39-2
Parts of the Type Library editor . . . . . . . 39-2
Toolbar . . . . . . . . . . . . . . . . . . . 39-3
Object list pane. . . . . . . . . . . . . . . 39-4
Status bar . . . . . . . . . . . . . . . . . . 39-5
Pages of type information. . . . . . . . . 39-5
Type library elements . . . . . . . . . . . . . 39-8
Interfaces . . . . . . . . . . . . . . . . . . 39-8
Dispinterfaces . . . . . . . . . . . . . . . 39-9
CoClasses. . . . . . . . . . . . . . . . . . 39-9
Type definitions . . . . . . . . . . . . . . 39-9
Modules. . . . . . . . . . . . . . . . . . 39-10
Using the Type Library editor . . . . . . . 39-10
Valid types . . . . . . . . . . . . . . . . .39-11
Creating a new type library. . . . . . . 39-12
xxi
Opening an existing type library . . . . 39-13
Adding an interface to the type
library . . . . . . . . . . . . . . . . . . 39-13
Modifying an interface using the
type library . . . . . . . . . . . . . . . 39-14
Adding properties and methods
to an interface or dispinterface . . . . 39-14
Adding a CoClass to the type
library . . . . . . . . . . . . . . . . . . 39-15
Adding an interface to a CoClass . . . . 39-15
Adding an enumeration to the
type library . . . . . . . . . . . . . . . 39-16
Adding an alias to the type
library . . . . . . . . . . . . . . . . . . 39-16
Adding a record or union to the
type library . . . . . . . . . . . . . . . 39-16
Adding a module to the type
library . . . . . . . . . . . . . . . . . . 39-17
Saving and registering type
library information . . . . . . . . . . . 39-17
Saving a type library . . . . . . . . . . . 39-18
Refreshing the type library . . . . . . . 39-18
Registering the type library . . . . . . . 39-18
Exporting an IDL file . . . . . . . . . . . 39-19
Deploying type libraries . . . . . . . . . . . . 39-19
Chapter 40
Creating COM clients 40-1
Importing type library information . . . . . . .40-2
Using the Import Type Library
dialog . . . . . . . . . . . . . . . . . . . . .40-3
Using the Import ActiveX dialog . . . . . . .40-4
Code generated when you import
type library information . . . . . . . . . . .40-5
Controlling an imported object. . . . . . . . . .40-6
Using component wrappers. . . . . . . . . .40-6
ActiveX wrappers. . . . . . . . . . . . . .40-7
Automation object wrappers . . . . . . .40-7
Using data-aware ActiveX controls . . . . .40-8
Example: Printing a document with
Microsoft Word . . . . . . . . . . . . . . . 40-10
Step 1: Prepare C Builder for this
example . . . . . . . . . . . . . . . . . 40-10
Step 2: Import the Word type
library . . . . . . . . . . . . . . . . . . 40-10
Step 3: Use a VTable or dispatch
interface object to control Microsoft
Word . . . . . . . . . . . . . . . . . . . 40-11
Step 4: Clean up the example . . . . . . 40-12
Writing client code based on type
library definitions . . . . . . . . . . . . . 40-12
Connecting to a server . . . . . . . . . 40-12
Controlling an Automation server
using a dual interface . . . . . . . . . 40-13
Controlling an Automation server
using a dispatch interface . . . . . . . 40-13
Handling events in an automation
controller . . . . . . . . . . . . . . . . 40-14
Creating clients for servers that do not
have a type library . . . . . . . . . . . . . . 40-15
Chapter 41
Creating simple COM servers 41-1
Overview of creating a COM object. . . . . . . 41-1
Designing a COM object . . . . . . . . . . . . . 41-2
Using the COM object wizard . . . . . . . . . . 41-2
Using the Automation object wizard . . . . . . 41-4
Choosing a threading model. . . . . . . . . 41-5
Writing an object that supports the
free threading model. . . . . . . . . . . 41-6
Writing an object that supports
the apartment threading model . . . . 41-7
Writing an object that supports
the neutral threading model . . . . . . 41-8
Specifying ATL options . . . . . . . . . . . . . 41-8
Defining a COM object’s interface . . . . . . . 41-9
Adding a property to the object’s
interface. . . . . . . . . . . . . . . . . . . . 41-9
Adding a method to the object’s
interface. . . . . . . . . . . . . . . . . . . 41-10
Exposing events to clients . . . . . . . . . 41-10
Managing events in your Auto-
mation object . . . . . . . . . . . . . . .41-11
Automation interfaces . . . . . . . . . . . . . 41-12
Dual interfaces. . . . . . . . . . . . . . . . 41-12
Dispatch interfaces . . . . . . . . . . . . . 41-13
Custom interfaces . . . . . . . . . . . . . . 41-14
Marshaling data. . . . . . . . . . . . . . . . . 41-14
Automation compatible types . . . . . . . 41-14
Type restrictions for automatic
marshaling . . . . . . . . . . . . . . . . . 41-15
Custom marshaling . . . . . . . . . . . . . 41-15
Registering a COM object . . . . . . . . . . . 41-16
Registering an in-process server. . . . . . 41-16
Registering an out-of-process
server . . . . . . . . . . . . . . . . . . . . 41-16
Testing and debugging the
application . . . . . . . . . . . . . . . . . . . 41-17
xxii
Chapter 42
Creating an Active Server Page 42-1
Creating an Active Server Object. . . . . . . . .42-2
Using the ASP intrinsics. . . . . . . . . . . .42-3
Application . . . . . . . . . . . . . . . . .42-3
Request. . . . . . . . . . . . . . . . . . . .42-4
Response. . . . . . . . . . . . . . . . . . .42-5
Session . . . . . . . . . . . . . . . . . . . .42-5
Server . . . . . . . . . . . . . . . . . . . .42-6
Creating ASPs for in-process or
out-of-process servers . . . . . . . . . . . .42-7
Registering an Active Server Object . . . . . . .42-7
Registering an in-process server . . . . . . .42-7
Registering an out-of-process server . . . . .42-8
Testing and debugging the Active Server
Page application . . . . . . . . . . . . . . . . .42-8
Chapter 43
Creating an ActiveX control 43-1
Overview of ActiveX control creation . . . . . .43-2
Elements of an ActiveX control . . . . . . . .43-2
VCL control . . . . . . . . . . . . . . . . .43-3
ActiveX wrapper . . . . . . . . . . . . . .43-3
Type library . . . . . . . . . . . . . . . . .43-3
Property page . . . . . . . . . . . . . . . .43-3
Designing an ActiveX control . . . . . . . . . .43-4
Generating an ActiveX control from
a VCL control. . . . . . . . . . . . . . . . . . .43-4
Generating an ActiveX control based
on a VCL form . . . . . . . . . . . . . . . . . .43-6
Licensing ActiveX controls . . . . . . . . . . . .43-7
Customizing the ActiveX control’s
interface . . . . . . . . . . . . . . . . . . . . . .43-8
Adding additional properties,
methods, and events . . . . . . . . . . . . .43-9
Adding properties and
methods . . . . . . . . . . . . . . . . . .43-9
Adding events. . . . . . . . . . . . . . . 43-10
Enabling simple data binding with
the type library . . . . . . . . . . . . . . . 43-11
Creating a property page for an
ActiveX control. . . . . . . . . . . . . . . . . 43-13
Creating a new property page . . . . . . . 43-13
Adding controls to a property page . . . . 43-14
Associating property page controls
with ActiveX control properties. . . . . . 43-14
Updating the property page. . . . . . . 43-14
Updating the object. . . . . . . . . . . . 43-15
Connecting a property page to an
ActiveX control . . . . . . . . . . . . . . 43-15
Registering an ActiveX control . . . . . . . . 43-15
Testing an ActiveX control. . . . . . . . . . . 43-16
Deploying an ActiveX control on
the Web. . . . . . . . . . . . . . . . . . . . . 43-16
Setting options. . . . . . . . . . . . . . . . 43-17
Chapter 44
Creating MTS or COM objects 44-1
Understanding transactional objects . . . . . . 44-2
Requirements for a transactional
object . . . . . . . . . . . . . . . . . . . . . 44-3
Managing resources . . . . . . . . . . . . . . . 44-3
Accessing the object context . . . . . . . . . 44-4
Just-in-time activation . . . . . . . . . . . . 44-4
Resource pooling . . . . . . . . . . . . . . . 44-5
Database resource dispensers . . . . . . 44-6
Shared property manager. . . . . . . . . 44-6
Releasing resources . . . . . . . . . . . . 44-9
Object pooling . . . . . . . . . . . . . . . . . 44-9
MTS and COM transaction support. . . . . 44-10
Transaction attributes. . . . . . . . . . . . .44-11
Setting the transaction attribute . . . . .44-11
Stateful and stateless objects . . . . . . . . 44-12
Influencing how transactions end . . . . . 44-12
Initiating transactions. . . . . . . . . . . . 44-13
Setting up a transaction object
on the client side . . . . . . . . . . . . 44-13
Setting up a transaction object
on the server side . . . . . . . . . . . 44-14
Transaction time-out . . . . . . . . . . . . 44-15
Role-based security . . . . . . . . . . . . . . . 44-16
Overview of creating transactional
objects . . . . . . . . . . . . . . . . . . . . . 44-17
Using the Transactional Object
wizard . . . . . . . . . . . . . . . . . . . . . 44-17
Choosing a threading model for
a transactional object . . . . . . . . . . . 44-18
Activities . . . . . . . . . . . . . . . . . 44-19
Generating events under COM . . . . . . . 44-20
Using the Event Object wizard. . . . . . . 44-22
Using the COM Event Subscription
object wizard. . . . . . . . . . . . . . . . 44-23
Firing events using a COM event
object . . . . . . . . . . . . . . . . . . . . 44-24
Passing object references . . . . . . . . . . . . 44-24
Using the SafeRef method . . . . . . . 44-25
Callbacks . . . . . . . . . . . . . . . . . 44-25
xxiii
Debugging and testing transactional
objects . . . . . . . . . . . . . . . . . . . . . . 44-26
Installing transactional objects . . . . . . . . . 44-27
Administering transactional objects . . . . . . 44-28
Part V
Creating custom components
Chapter 45
Overview of component creation 45-1
Class libraries. . . . . . . . . . . . . . . . . . . .45-1
Components and classes . . . . . . . . . . . . .45-2
How do you create components? . . . . . . . .45-2
Modifying existing controls . . . . . . . . . .45-3
Creating windowed controls . . . . . . . . .45-3
Creating graphic controls . . . . . . . . . . .45-4
Subclassing Windows controls . . . . . . . .45-4
Creating nonvisual components . . . . . . .45-5
What goes into a component? . . . . . . . . . .45-5
Removing dependencies. . . . . . . . . . . .45-5
Setting properties, methods, and
events . . . . . . . . . . . . . . . . . . . . .45-6
Properties . . . . . . . . . . . . . . . . . .45-6
Events . . . . . . . . . . . . . . . . . . . .45-6
Methods . . . . . . . . . . . . . . . . . . .45-6
Encapsulating graphics . . . . . . . . . . . .45-7
Registering components. . . . . . . . . . . .45-8
Creating a new component . . . . . . . . . . . .45-8
Creating a component with the
Component wizard. . . . . . . . . . . . . .45-9
Creating a component manually . . . . . . 45-11
Creating a unit file . . . . . . . . . . . . 45-11
Deriving the component . . . . . . . . . 45-12
Declaring a new constructor. . . . . . . 45-13
Registering the component . . . . . . . 45-13
Creating a bitmap for a component . . . . 45-14
Testing uninstalled components . . . . . . . . 45-16
Testing installed components. . . . . . . . . . 45-18
Installing a component on the
Component palette. . . . . . . . . . . . . . . 45-18
Making source files available . . . . . . . . 45-19
Adding the component . . . . . . . . . . . 45-19
Chapter 46
Object-oriented programming for
component writers 46-1
Defining new classes . . . . . . . . . . . . . . .46-1
Deriving new classes. . . . . . . . . . . . . .46-2
To change class defaults to avoid
repetition . . . . . . . . . . . . . . . . . 46-2
To add new capabilities to a
class . . . . . . . . . . . . . . . . . . . . 46-2
Declaring a new component class . . . . . . 46-3
Ancestors, descendants, and class
hierarchies . . . . . . . . . . . . . . . . . . . . 46-3
Controlling access. . . . . . . . . . . . . . . . . 46-4
Hiding implementation details . . . . . . . 46-4
Defining the component writer’s
interface. . . . . . . . . . . . . . . . . . . . 46-6
Defining the runtime interface. . . . . . . . 46-7
Defining the design-time interface . . . . . 46-7
Dispatching methods. . . . . . . . . . . . . . . 46-8
Regular methods . . . . . . . . . . . . . . . 46-8
Virtual methods . . . . . . . . . . . . . . . . 46-9
Overriding methods. . . . . . . . . . . . 46-9
Abstract class members . . . . . . . . . . . . 46-10
Classes and pointers . . . . . . . . . . . . . . 46-10
Chapter 47
Creating properties 47-1
Why create properties?. . . . . . . . . . . . . . 47-1
Types of properties . . . . . . . . . . . . . . . . 47-2
Publishing inherited properties . . . . . . . . . 47-3
Defining properties . . . . . . . . . . . . . . . . 47-3
The property declaration . . . . . . . . . . . 47-3
Internal data storage . . . . . . . . . . . . . 47-4
Direct access . . . . . . . . . . . . . . . . . . 47-4
Access methods . . . . . . . . . . . . . . . . 47-5
The read method. . . . . . . . . . . . . . 47-6
The write method . . . . . . . . . . . . . 47-6
Default property values . . . . . . . . . . . 47-7
Specifying no default value. . . . . . . . 47-7
Creating array properties . . . . . . . . . . . . 47-8
Creating properties for sub-
components . . . . . . . . . . . . . . . . . . . 47-9
Storing and loading properties . . . . . . . . 47-10
Using the store-and-load
mechanism . . . . . . . . . . . . . . . . . .47-11
Specifying default values. . . . . . . . . . .47-11
Determining what to store . . . . . . . . . 47-12
Initializing after loading . . . . . . . . . . 47-13
Storing and loading unpublished
properties. . . . . . . . . . . . . . . . . . 47-13
Creating methods to store and
load property values. . . . . . . . . . 47-13
Overriding the DefineProperties
method . . . . . . . . . . . . . . . . . 47-14
xxiv
Chapter 48
Creating events 48-1
What are events?. . . . . . . . . . . . . . . . . .48-1
Events are closures . . . . . . . . . . . . . . .48-2
Events are properties. . . . . . . . . . . . . .48-2
Event types are closure types . . . . . . . . .48-3
Event handlers have a return
type of void . . . . . . . . . . . . . . . .48-3
Event handlers are optional . . . . . . . . . .48-3
Implementing the standard events. . . . . . . .48-4
Identifying standard events. . . . . . . . . .48-4
Standard events for all controls . . . . . .48-4
Standard events for standard
controls. . . . . . . . . . . . . . . . . . .48-5
Making events visible . . . . . . . . . . . . .48-5
Changing the standard event
handling . . . . . . . . . . . . . . . . . . . .48-5
Defining your own events . . . . . . . . . . . .48-6
Triggering the event . . . . . . . . . . . . . .48-6
Two kinds of events . . . . . . . . . . . .48-7
Defining the handler type . . . . . . . . . . .48-7
Simple notifications. . . . . . . . . . . . .48-7
Event-specific handlers. . . . . . . . . . .48-7
Returning information from
the handler. . . . . . . . . . . . . . . . .48-7
Declaring the event. . . . . . . . . . . . . . .48-8
Event names start with “On” . . . . . . .48-8
Calling the event . . . . . . . . . . . . . . . .48-8
Chapter 49
Creating methods 49-1
Avoiding dependencies . . . . . . . . . . . . . .49-1
Naming methods . . . . . . . . . . . . . . . . .49-2
Protecting methods . . . . . . . . . . . . . . . .49-3
Methods that should be public . . . . . . . .49-3
Methods that should be protected . . . . . .49-3
Making methods virtual . . . . . . . . . . . . .49-3
Declaring methods. . . . . . . . . . . . . . . . .49-4
Chapter 50
Using graphics in components 50-1
Overview of graphics . . . . . . . . . . . . . . .50-1
Using the canvas . . . . . . . . . . . . . . . . . .50-3
Working with pictures. . . . . . . . . . . . . . .50-3
Using a picture, graphic, or canvas. . . . . .50-3
Loading and storing graphics. . . . . . . . .50-4
Handling palettes . . . . . . . . . . . . . . . 50-5
Specifying a palette for a control. . . . . 50-5
Off-screen bitmaps . . . . . . . . . . . . . . . . 50-6
Creating and managing off-screen
bitmaps . . . . . . . . . . . . . . . . . . . . 50-6
Copying bitmapped images . . . . . . . . . 50-6
Responding to changes. . . . . . . . . . . . . . 50-7
Chapter 51
Handling messages and system
notifications 51-1
Understanding the message-handling
system . . . . . . . . . . . . . . . . . . . . . . 51-1
What’s in a Windows message? . . . . . . . 51-2
Dispatching messages. . . . . . . . . . . . . 51-3
Tracing the flow of messages . . . . . . . 51-3
Changing message handling. . . . . . . . . . . 51-4
Overriding the handler method . . . . . . . 51-4
Using message parameters. . . . . . . . . . 51-5
Trapping messages . . . . . . . . . . . . . . 51-5
Creating new message handlers. . . . . . . . . 51-6
Defining your own messages . . . . . . . . 51-6
Declaring a message identifier . . . . . . 51-6
Declaring a message-structure
type . . . . . . . . . . . . . . . . . . . . 51-7
Declaring a new message-handling
method . . . . . . . . . . . . . . . . . . . . 51-7
Sending messages . . . . . . . . . . . . . . . 51-8
Broadcasting a message to all
controls in a form . . . . . . . . . . . . 51-8
Calling a control’s message
handler directly . . . . . . . . . . . . . 51-9
Sending a message using the
Windows message queue . . . . . . . . 51-9
Sending a message that does
not execute immediately . . . . . . . 51-10
Responding to system notifications
using CLX . . . . . . . . . . . . . . . . . . . 51-10
Responding to signals. . . . . . . . . . . . 51-10
Assigning custom signal
handlers. . . . . . . . . . . . . . . . . .51-11
Responding to system events . . . . . . . 51-12
Commonly used events . . . . . . . . . 51-13
Overriding the EventFilter
method . . . . . . . . . . . . . . . . . 51-14
Generating Qt events . . . . . . . . . . 51-15
xxv
Chapter 52
Making components available
at design time 52-1
Registering components. . . . . . . . . . . . . .52-1
Declaring the Register function. . . . . . . .52-2
Writing the Register function . . . . . . . . .52-2
Specifying the components . . . . . . . .52-2
Specifying the palette page . . . . . . . .52-3
Using the RegisterComponents
function . . . . . . . . . . . . . . . . . .52-3
Adding palette bitmaps . . . . . . . . . . . . . .52-4
Providing Help for your component. . . . . . .52-4
Creating the Help file . . . . . . . . . . . . .52-5
Creating the entries. . . . . . . . . . . . .52-5
Making component help
context-sensitive . . . . . . . . . . . . .52-6
Adding component help files . . . . . . .52-7
Adding property editors . . . . . . . . . . . . .52-7
Deriving a property-editor class . . . . . . .52-7
Editing the property as text . . . . . . . . . .52-8
Displaying the property value. . . . . . .52-9
Setting the property value . . . . . . . . .52-9
Editing the property as a whole . . . . . . .52-9
Specifying editor attributes . . . . . . . . . 52-10
Registering the property editor. . . . . . . 52-11
Property categories . . . . . . . . . . . . . . . 52-12
Registering one property at a time . . . . . 52-12
Registering multiple properties
at once . . . . . . . . . . . . . . . . . . . . 52-13
Specifying property categories . . . . . . . 52-14
Using the IsPropertyInCategory
function . . . . . . . . . . . . . . . . . . . 52-15
Adding component editors . . . . . . . . . . . 52-15
Adding items to the context menu . . . . . 52-16
Specifying menu items . . . . . . . . . . 52-16
Implementing commands . . . . . . . . 52-16
Changing the double-click behavior . . . . 52-17
Adding clipboard formats. . . . . . . . . . 52-18
Registering the component editor . . . . . 52-18
Compiling components into packages. . . . . 52-19
Troubleshooting custom components . . . . . 52-19
Chapter 53
Modifying an existing component 53-1
Creating and registering the component . . . .53-1
Modifying the component class . . . . . . . . .53-3
Overriding the constructor . . . . . . . . . .53-3
Specifying the new default property
value . . . . . . . . . . . . . . . . . . . . . 53-4
Chapter 54
Creating a graphic control 54-1
Creating and registering the
component . . . . . . . . . . . . . . . . . . . . 54-1
Publishing inherited properties . . . . . . . . . 54-3
Adding graphic capabilities . . . . . . . . . . . 54-3
Determining what to draw. . . . . . . . . . 54-3
Declaring the property type . . . . . . . 54-4
Declaring the property . . . . . . . . . . 54-4
Writing the implementation
method . . . . . . . . . . . . . . . . . . 54-5
Overriding the constructor and
destructor. . . . . . . . . . . . . . . . . . . 54-5
Changing default property values. . . . 54-5
Publishing the pen and brush . . . . . . . . 54-6
Declaring the data members . . . . . . . 54-6
Declaring the access properties. . . . . . 54-6
Initializing owned classes. . . . . . . . . 54-7
Setting owned classes’ properties . . . . 54-8
Drawing the component image . . . . . . . 54-9
Refining the shape drawing . . . . . . . . 54-10
Chapter 55
Customizing a grid 55-1
Creating and registering the
component . . . . . . . . . . . . . . . . . . . . 55-1
Publishing inherited properties . . . . . . . . . 55-3
Changing initial values. . . . . . . . . . . . . . 55-3
Resizing the cells . . . . . . . . . . . . . . . . . 55-4
Filling in the cells . . . . . . . . . . . . . . . . . 55-6
Tracking the date . . . . . . . . . . . . . . . 55-6
Storing the internal date . . . . . . . . . 55-7
Accessing the day, month, and
year . . . . . . . . . . . . . . . . . . . . 55-7
Generating the day numbers . . . . . . . 55-9
Selecting the current day . . . . . . . . .55-11
Navigating months and years . . . . . . . . . .55-11
Navigating days. . . . . . . . . . . . . . . . . 55-12
Moving the selection . . . . . . . . . . . . 55-12
Providing an OnChange event. . . . . . . 55-13
Excluding blank cells . . . . . . . . . . . . 55-14
Chapter 56
Making a control data aware 56-1
Creating a data browsing control . . . . . . . . 56-1
xxvi
Creating and registering the
component. . . . . . . . . . . . . . . . . . .56-2
Making the control read-only . . . . . . . . .56-3
Adding the ReadOnly property. . . . . .56-3
Allowing needed updates . . . . . . . . .56-4
Adding the data link. . . . . . . . . . . . . .56-5
Declaring the data member . . . . . . . .56-5
Declaring the access properties . . . . . .56-6
An example of declaring access
properties . . . . . . . . . . . . . . . . .56-6
Initializing the data link . . . . . . . . . .56-7
Responding to data changes . . . . . . . . .56-7
Creating a data editing control . . . . . . . . . .56-8
Changing the default value of
FReadOnly . . . . . . . . . . . . . . . . . .56-9
Handling mouse-down and key-down
messages. . . . . . . . . . . . . . . . . . . .56-9
Responding to mouse-down
messages . . . . . . . . . . . . . . . . . .56-9
Responding to key-down
messages . . . . . . . . . . . . . . . . . 56-10
Updating the field data link class. . . . . . 56-11
Modifying the Change method . . . . . . . 56-11
Updating the dataset. . . . . . . . . . . . . 56-12
Chapter 57
Making a dialog box a
component 57-1
Defining the component interface . . . . . . . .57-1
Creating and registering the
component . . . . . . . . . . . . . . . . . . . .57-2
Creating the component interface . . . . . . . .57-3
Including the form unit files . . . . . . . . .57-3
Adding interface properties. . . . . . . . . .57-4
Adding the Execute method . . . . . . . . .57-5
Testing the component . . . . . . . . . . . . . .57-6
Chapter 58
Extending the IDE 58-1
Overview of the Tools API . . . . . . . . . . . .58-2
Writing a wizard class. . . . . . . . . . . . . . .58-3
Implementing the wizard interfaces . . . . .58-4
Simplifying implementing interfaces . . . .58-6
Installing the wizard package. . . . . . . . .58-7
Obtaining Tools API services . . . . . . . . . . .58-7
Using native IDE objects. . . . . . . . . . . .58-8
Using the INTAServices interface. . . . .58-9
Adding an image to the image list . . . .58-9
Adding an action to the action list . . . .58-9
Deleting toolbar buttons . . . . . . . . 58-10
Debugging a wizard . . . . . . . . . . . . .58-11
Interface version numbers . . . . . . . . . .58-11
Working with files and editors . . . . . . . . 58-12
Using module interfaces . . . . . . . . . . 58-13
Using editor interfaces . . . . . . . . . . . 58-13
Creating forms and projects . . . . . . . . . . 58-14
Creating modules . . . . . . . . . . . . . . 58-14
Notifying a wizard of IDE events . . . . . . . 58-18
Installing a wizard DLL . . . . . . . . . . . . 58-22
Using a DLL without runtime
packages . . . . . . . . . . . . . . . . . . 58-23
Appendix A
ANSI implementation-specific
standards A-1
Appendix B
WebSnap server-side scripting
reference B-1
Object types . . . . . . . . . . . . . . . . . . . . .B-1
Adapter type. . . . . . . . . . . . . . . . . . .B-2
Properties. . . . . . . . . . . . . . . . . . .B-2
AdapterAction type. . . . . . . . . . . . . . .B-4
Properties. . . . . . . . . . . . . . . . . . .B-4
Methods. . . . . . . . . . . . . . . . . . . .B-6
AdapterErrors type . . . . . . . . . . . . . . .B-6
Properties. . . . . . . . . . . . . . . . . . .B-6
AdapterField type. . . . . . . . . . . . . . . .B-6
Properties. . . . . . . . . . . . . . . . . . .B-6
Methods. . . . . . . . . . . . . . . . . . . .B-9
AdapterFieldValues type . . . . . . . . . . . B-10
Properties. . . . . . . . . . . . . . . . . . B-10
Methods. . . . . . . . . . . . . . . . . . . B-10
AdapterFieldValuesList type. . . . . . . . . B-10
Properties. . . . . . . . . . . . . . . . . . B-10
Methods. . . . . . . . . . . . . . . . . . . B-11
AdapterHiddenFields type. . . . . . . . . . B-11
Properties. . . . . . . . . . . . . . . . . . B-11
Methods. . . . . . . . . . . . . . . . . . . B-11
AdapterImage type . . . . . . . . . . . . . . B-12
Properties. . . . . . . . . . . . . . . . . . B-12
Module type . . . . . . . . . . . . . . . . . . B-12
Properties. . . . . . . . . . . . . . . . . . B-12
Page type. . . . . . . . . . . . . . . . . . . . B-12
Properties. . . . . . . . . . . . . . . . . . B-12
Global objects . . . . . . . . . . . . . . . . . . . B-14
Application object. . . . . . . . . . . . . . . B-14
xxvii
Properties . . . . . . . . . . . . . . . . . .B-14
Methods . . . . . . . . . . . . . . . . . . .B-15
EndUser object . . . . . . . . . . . . . . . . .B-15
Properties . . . . . . . . . . . . . . . . . .B-15
Modules object . . . . . . . . . . . . . . . . .B-16
Page object . . . . . . . . . . . . . . . . . . .B-16
Pages object . . . . . . . . . . . . . . . . . . .B-16
Producer object . . . . . . . . . . . . . . . . .B-17
Properties . . . . . . . . . . . . . . . . . .B-17
Methods . . . . . . . . . . . . . . . . . . .B-17
Request object. . . . . . . . . . . . . . . . . .B-17
Properties . . . . . . . . . . . . . . . . . .B-17
Response object. . . . . . . . . . . . . . . . .B-18
Properties . . . . . . . . . . . . . . . . . .B-18
Methods . . . . . . . . . . . . . . . . . . .B-18
Session object . . . . . . . . . . . . . . . . . .B-18
Properties . . . . . . . . . . . . . . . . . .B-18
JScript Examples . . . . . . . . . . . . . . . . . .B-19
Example 1 . . . . . . . . . . . . . . . . . . . .B-20
Example 2 . . . . . . . . . . . . . . . . . . . .B-20
Example 3 . . . . . . . . . . . . . . . . . . . .B-20
Example 4 . . . . . . . . . . . . . . . . . . . B-21
Example 5 . . . . . . . . . . . . . . . . . . . B-21
Example 6 . . . . . . . . . . . . . . . . . . . B-22
Example 7 . . . . . . . . . . . . . . . . . . . B-22
Example 8 . . . . . . . . . . . . . . . . . . . B-23
Example 9 . . . . . . . . . . . . . . . . . . . B-23
Example 10. . . . . . . . . . . . . . . . . . . B-24
Example 11 . . . . . . . . . . . . . . . . . . . B-26
Example 12. . . . . . . . . . . . . . . . . . . B-27
Example 13. . . . . . . . . . . . . . . . . . . B-28
Example 14. . . . . . . . . . . . . . . . . . . B-29
Example 15. . . . . . . . . . . . . . . . . . . B-30
Example 16. . . . . . . . . . . . . . . . . . . B-32
Example 17. . . . . . . . . . . . . . . . . . . B-33
Example 18. . . . . . . . . . . . . . . . . . . B-34
Example 19. . . . . . . . . . . . . . . . . . . B-35
Example 20. . . . . . . . . . . . . . . . . . . B-35
Example 21. . . . . . . . . . . . . . . . . . . B-36
Example 22. . . . . . . . . . . . . . . . . . . B-37
Index I-1
Tables
xxix
19.2 Column properties. . . . . . . . . . . . . 19-20
19.3 Expanded TColumn Title
properties. . . . . . . . . . . . . . . . . . 19-20
19.4 Properties that affect the way
composite fields appear. . . . . . . . . . 19-23
19.5 Expanded TDBGrid Options
properties. . . . . . . . . . . . . . . . . . 19-24
19.6 Grid control events . . . . . . . . . . . . 19-26
19.7 Selected database control grid
properties. . . . . . . . . . . . . . . . . . 19-28
19.8 TDBNavigator buttons . . . . . . . . . . 19-29
21.1 Database connection components . . . . .21-1
22.1 Values for the dataset State
property. . . . . . . . . . . . . . . . . . . .22-3
22.2 Navigational methods of datasets . . . . .22-5
22.3 Navigational properties of datasets . . . .22-6
22.4 Comparison and logical operators
that can appear in a filter . . . . . . . . . 22-14
22.5 FilterOptions values. . . . . . . . . . . . 22-15
22.6 Filtered dataset navigational
methods. . . . . . . . . . . . . . . . . . . 22-16
22.7 Dataset methods for inserting,
updating, and deleting data . . . . . . . 22-17
22.8 Methods that work with entire
records . . . . . . . . . . . . . . . . . . . 22-21
22.9 Index-based search methods . . . . . . . 22-27
23.1 TFloatField properties that affect
data display . . . . . . . . . . . . . . . . .23-1
23.2 Special persistent field kinds . . . . . . . .23-6
23.3 Field component properties . . . . . . . 23-11
23.4 Field component formatting
routines . . . . . . . . . . . . . . . . . . . 23-15
23.5 Field component events. . . . . . . . . . 23-15
23.6 Selected field component
methods. . . . . . . . . . . . . . . . . . . 23-16
23.7 Special conversion results . . . . . . . . 23-19
23.8 Types of object field components . . . . 23-22
23.9 Common object field descendant
properties. . . . . . . . . . . . . . . . . . 23-23
24.1 Table types recognized by the BDE
based on file extension . . . . . . . . . . .24-5
24.2 TableType values. . . . . . . . . . . . . . .24-5
24.3 BatchMove import modes . . . . . . . . .24-8
24.4 Database-related informational
methods for session components . . . . 24-26
24.5 TSessionList properties and
methods. . . . . . . . . . . . . . . . . . . 24-28
24.6 Properties, methods, and events
for cached updates. . . . . . . . . . . . . 24-32
24.7 UpdateKind values. . . . . . . . . . . . 24-38
24.8 Batch move modes . . . . . . . . . . . . 24-48
24.9 Data Dictionary interface . . . . . . . . 24-52
25.1 ADO components. . . . . . . . . . . . . . 25-2
25.2 ADO connection modes . . . . . . . . . . 25-6
25.3 Execution options for ADO
datasets . . . . . . . . . . . . . . . . . . .25-11
25.4 Comparison of ADO and client
dataset cached updates. . . . . . . . . . 25-12
26.1 Columns in tables of metadata listing
tables . . . . . . . . . . . . . . . . . . . . 26-13
26.2 Columns in tables of metadata listing
stored procedures. . . . . . . . . . . . . 26-14
26.3 Columns in tables of metadata listing
fields . . . . . . . . . . . . . . . . . . . . 26-14
26.4 Columns in tables of metadata listing
indexes. . . . . . . . . . . . . . . . . . . 26-15
26.5 Columns in tables of metadata listing
parameters. . . . . . . . . . . . . . . . . 26-16
27.1 Filter support in client datasets . . . . . . 27-3
27.2 Summary operators for maintained
aggregates . . . . . . . . . . . . . . . . . 27-12
27.3 Specialized client datasets for caching
updates . . . . . . . . . . . . . . . . . . 27-17
28.1 AppServer interface members. . . . . . . 28-3
28.2 Provider options . . . . . . . . . . . . . . 28-5
28.3 UpdateStatus values . . . . . . . . . . . . 28-9
28.4 UpdateMode values . . . . . . . . . . . 28-10
28.5 ProviderFlags values . . . . . . . . . . . 28-10
29.1 Components used in multi-tiered
applications . . . . . . . . . . . . . . . . . 29-3
29.2 Connection components . . . . . . . . . . 29-5
29.3 Javascript libraries . . . . . . . . . . . . 29-33
32.1 Web Broker versus WebSnap . . . . . . . 32-2
33.1 MethodType values. . . . . . . . . . . . . 33-6
34.1 Web application module types . . . . . . 34-3
34.2 Web server application types . . . . . . . 34-8
34.3 Web application components . . . . . . . 34-9
34.4 Script objects . . . . . . . . . . . . . . . 34-33
34.5 Request information found in action
requests . . . . . . . . . . . . . . . . . . 34-36
36.1 Remotable classes. . . . . . . . . . . . . . 36-7
38.1 COM object requirements . . . . . . . . 38-12
38.2 C Builder wizards for implementing
COM, Automation, and ActiveX
objects . . . . . . . . . . . . . . . . . . . 38-20
39.1 Type Library editor files . . . . . . . . . . 39-2
39.2 Type Library editor parts . . . . . . . . . 39-2
39.3 Type library pages . . . . . . . . . . . . . 39-5
xxx
41.1 Threading models for COM
objects. . . . . . . . . . . . . . . . . . . . .41-5
42.1 IApplicationObject interface
members . . . . . . . . . . . . . . . . . . .42-4
42.2 IRequest interface members . . . . . . . .42-4
42.3 IResponse interface members . . . . . . .42-5
42.4 ISessionObject interface members . . . . .42-6
42.5 IServer interface members . . . . . . . . .42-6
44.1 IObjectContext methods for
transaction support . . . . . . . . . . . . 44-12
44.2 Threading models for transactional
objects. . . . . . . . . . . . . . . . . . . . 44-18
44.3 Call synchronization options. . . . . . . 44-20
44.4 Event publisher return codes. . . . . . . 44-24
45.1 Component creation starting
points . . . . . . . . . . . . . . . . . . . . .45-3
46.1 Levels of visibility within an
object . . . . . . . . . . . . . . . . . . . . .46-4
47.1 How properties appear in the
Object Inspector . . . . . . . . . . . . . .47-2
50.1 Canvas capability summary . . . . . . . .50-3
50.2 Image-copying methods . . . . . . . . . .50-6
51.1 TWidgetControl protected methods
for responding to system
notifications . . . . . . . . . . . . . . . . 51-13
51.2 TWidgetControl protected methods
for responding to events from
controls. . . . . . . . . . . . . . . . . . . 51-14
52.1 Predefined property-editor types. . . . . 52-8
52.2 Methods for reading and writing
property values . . . . . . . . . . . . . . . 52-9
52.3 Property-editor attribute flags. . . . . . 52-10
52.4 Property categories . . . . . . . . . . . . 52-14
58.1 The four kinds of wizards . . . . . . . . . 58-3
58.2 Tools API service interfaces . . . . . . . . 58-8
58.3 Notifier interfaces. . . . . . . . . . . . . 58-18
A.1 Options needed for ANSI
compliance . . . . . . . . . . . . . . . . . A-1
A.2 Identifying diagnostics in C . . . . . . A-3
B.1 WebSnap object types . . . . . . . . . . . .B-2
B.2 WebSnap global objects . . . . . . . . . . B-14
B.3 JScript examples of server-side
scripting . . . . . . . . . . . . . . . . . . . B-19
xxxi
3.1 Objects, components, and controls. . . . . 3-4
3.2 A simplified hierarchy diagram . . . . . . 3-4
8.1 A frame with data-aware controls
and a data source component . . . . . . .8-15
8.3 Menu terminology. . . . . . . . . . . . . .8-29
8.4 MainMenu and PopupMenu
components . . . . . . . . . . . . . . . . .8-30
8.6 Adding menu items to a main
menu . . . . . . . . . . . . . . . . . . . . .8-33
8.7 Nested menu structures. . . . . . . . . . .8-34
9.2 A progress bar . . . . . . . . . . . . . . . .9-14
10.1 Bitmap-dimension dialog box
from the BMPDlg unit. . . . . . . . . . . 10-21
13.1 Order of VCL-style object
construction . . . . . . . . . . . . . . . . .13-9
16.1 TListBox set to bdLeftToRight . . . . . . .16-6
16.2 TListBox set to bdRightToLeft . . . . . . .16-6
16.3 TListBox set to bdRightToLeft
NoAlign. . . . . . . . . . . . . . . . . . . .16-6
16.4 TListBox set to bdRightToLeft
ReadingOnly . . . . . . . . . . . . . . . . .16-7
18.1 Generic Database Architecture. . . . . . .18-6
18.2 Connecting directly to the
database server. . . . . . . . . . . . . . . .18-8
18.3 A file-based database application . . . . .18-9
18.4 Architecture combining a client
dataset and another dataset . . . . . . . 18-12
18.5 Multi-tiered database
architecture. . . . . . . . . . . . . . . . . 18-13
19.1 TDBGrid control . . . . . . . . . . . . . . 19-15
19.2 TDBGrid control with ObjectView
set to false. . . . . . . . . . . . . . . . . . 19-23
19.3 TDBGrid control with Expanded
set to false. . . . . . . . . . . . . . . . . . 19-23
19.4 TDBGrid control with Expanded
set to true . . . . . . . . . . . . . . . . . . 19-23
19.5 TDBCtrlGrid at design time . . . . . . . 19-27
19.6 Buttons on the TDBNavigator
control. . . . . . . . . . . . . . . . . . . . 19-28
20.1 Decision support components
at design time . . . . . . . . . . . . . . . .20-2
20.2 One-dimensional crosstab . . . . . . . . .20-3
20.3 Three-dimensional crosstab . . . . . . . .20-3
20.4 Decision graphs bound to different
decision sources. . . . . . . . . . . . . . 20-14
24.1 Components in a BDE-based
application. . . . . . . . . . . . . . . . . . 24-2
29.1 Web-based multi-tiered database
application. . . . . . . . . . . . . . . . . 29-29
31.1 Structure of a CORBA application . . . . 31-2
32.1 Parts of a Uniform Resource
Locator. . . . . . . . . . . . . . . . . . . . 32-3
33.1 Structure of a Server Application . . . . . 33-3
34.2 Web App Components dialog. . . . . . . 34-9
34.5 CountryTable Preview tab . . . . . . . . 34-16
34.6 CountryTable HTML Script tab . . . . . 34-16
34.7 CountryTable Preview after editing
commands have been added . . . . . . 34-17
34.10 Web App Components dialog with
options for login support selected . . . 34-25
34.11 An example of a login page as seen
from a Web page editor . . . . . . . . . 34-27
34.12 Generating content flow. . . . . . . . . 34-35
34.13 Action request and response . . . . . . 34-37
34.14 Image response to a request. . . . . . . 34-38
34.15 Dispatching a page. . . . . . . . . . . . 34-39
38.1 A COM interface . . . . . . . . . . . . . . 38-3
38.2 Interface vtable . . . . . . . . . . . . . . . 38-5
38.3 In-process server . . . . . . . . . . . . . . 38-7
38.4 Out-of-process and remote
servers . . . . . . . . . . . . . . . . . . . . 38-8
38.5 COM-based technologies . . . . . . . . .38-11
38.6 Simple COM object interface . . . . . . 38-19
38.7 Automation object interface . . . . . . . 38-19
38.8 ActiveX object interface . . . . . . . . . 38-20
39.1 Type Library editor. . . . . . . . . . . . . 39-3
39.2 Object list pane . . . . . . . . . . . . . . . 39-4
41.1 Dual interface VTable . . . . . . . . . . 41-13
43.1 Mask Edit property page in design
mode . . . . . . . . . . . . . . . . . . . . 43-14
44.1 The COM Events system . . . . . . . . 44-22
45.1 Visual Component Library class
hierarchy. . . . . . . . . . . . . . . . . . . 45-2
45.2 Component wizard. . . . . . . . . . . . . 45-9
51.1 Signal routing . . . . . . . . . . . . . . . .51-11
51.2 System event routing. . . . . . . . . . . 51-13

实例下载地址

Borland.C++.Builder.6.Developer's.Guide

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警