Document directory
- Delphi4 Programming Technology insider
Delphi4 Programming Technology insider
DelphiTutorial Series of books(110)《Delphi4Programming Technology insider Organize netizens (state)Email:Shuaihj@163.com
:
Download
- Original Title: Charlie Calvert's Delphi 4 unleashed
- Author: Charlie calvert
- Translator: Xiaoxiang Studio
- Series name: Software Development Technology series
- Press: Machinery Industry Press
- ISBN: 7111072162
- Mounting time: 2000-7-1
- Published on: February 1, June 1999
- Page number: 986
- Version: 1-1
Introduction
This book provides a complete and comprehensive introduction to Delphi 4. Its main contents include COM and distributed computing, database programming, general programming problems, and graphics and DirectX programming. Through the study of this book, readers can not only quickly understand the essentials of Delphi 4 programming, but also master many new technologies, for example, you can create a com automatic server and client program, perform multi-layer database computing using MIDAS, and use DCOM cross-Network Distributed Database. The biggest feature of this book is the rich code. It not only describes the sample code in detail, but also contains the source programs not introduced in many books on the supporting CD. This book applies to programmers who use Delphi 4 programming.
Directory
Step 1
Chapter 1 Program Design Basics 1
Structure of the 1.1 book 2
1.2 example program 4
1.3 create well-designed programs 4
1.3.1 design problem: simple code 4
1.3.2 spiral increase 5
1.3.3 comparison between Good OOP and poor OOP 5
1.3.4 pay attention to flexible event handling procedures 6
1.3.5 be lazy in clarifying procedures 7
1.3.6 avoid using hidden data cross-link object 8
1.3.7 short Method 9
1.3.8 naming of variables, methods, and procedures 10
1.3.9 avoid feature drift 10
1.3.10 Create component 10
1.3.11 use third-party tools 11
1.4 considerations in the text of this book 12
1.4.1 unleash and merc40 packages 12
1.4.2 codebox Unit 13
1.4.3 create a network 13
1.4.4 Borland/Inprise Name Change 13
1.4.5 Code 14
1.5 Conclusion 14
Chapter 2 IDE and VCL enhancement 15
2.1 detachable toolbar 15
2.2 use tool window 16
2.3 use code explorer 18
2.4 new tool 21 in Delphi 4
2.4.1 use project manager and debugger 21
2.4.2 debug DLL 22
2.4.3 use module view 23
2.4.4 use Event Log window 23
2.4.5 CPU view 24
2.4.5 new feature 25 in the debugger
2.4.6 code browser and tooltip symbol insight 26
2.5 dock window 26
2.5.1 parking controls in Forms 27
2.5.2 Park Form 28 in Form
2.6 action list 31
2.6.1 use action list 31
2.6.2 use standard action 35
2.7 function overload 35
2.7.1 method overloading and inheritance 38
2.7.2 errors to be avoided during method overloading 40
2.7.3 default parameter 42
2.8 dynamic array 43
2.9 implements keyword 46
2.10 Conclusion 48
Chapter 4 Polymorphism 49
3.1 concept of polymorphism 49
3.1.1 comparison of value assignment and equals 49
3.1.2 simple example of polymorphism 50
3.2 polymorphism assignment capability 51
3.2.1 set sub-objects suitable for their parent objects 51
3.2.2 another side of polymorphism 52
3.3 Virtual Methods and polymorphism 53
3.3.1 classic shape demonstration 56
3.3.2 code 62 without polymorphism
3.4 VCL polymorphism 63
3.5 conclusion 65
Chapter 1 Exception Handling 66
4.1 how to handle exceptions in this Chapter 67
4.2 exception theory 67
4.2.1 abnormal functions 67
4.2.2 default Exception Handling Procedure 68
4.2.3 the entire program is a large try block 69
4.2.4 unhandled exceptions 69
4.3 exception class 70
4.4 basic exception syntax 71
4.4.1 a simple try... try t module 74
4.4.2 abnormal Association error string 75
4.4.3 locate the wrong address 76
4.4.4 Exception Handling summary 77
4.5 exception thrown 77
4.5.1 VCL exception Type 79
4.5.2 understand VCL exception class 81
4.5.3 run gauntlet: Multiple exception classes 82
4.5.4 catch exceptions in general except T statements 83
4.6 create and cause your own exceptions 83
4.7 and then exception 87
4.8 try .. Finally block 88
4.9 stream, exception, and free space 91
4.10 Replace the default exception handler 95
4.11 use resource tracking error string 97
4.12 conclusion 101
Chapter 4 thread 5th
5.1 process and memory 103
5.1.1 thread and multi-task 104
5.1.2 preemptible and non-preemptible multitasking 106
5.2 threads: A simple example 106
5.3 multi-threaded program 111
5.3.1 Use thread 115 in thread2 Program
5.3.2 pass a parameter 115 to the thread function
5.3.3 critical section: Allow multiple threads to work 117 at the same time
5.4 process mutex RMB 122
5.5 threads and VCL 126
5.6 thread-safe database access 127
5.7 VCL thread security object 128
5.8 use tthread object 128
5.9 set thread priority 137
5.10 re-access Delphi thread 142
5.11 conclusion 143
Part 2 create components
Chapter 1 Creating components (1) 6th
6.1 component principle 146
6.2 create a derived component for an existing component 146
6.2.1 create a simple component 146
6.2.2 bidirectional tool 150
6.2.3 register a component 151
6.2.4 change the default behavior of components 151
6.2.5 dynamically create and check components 152
6.3 package: Put components in component palette 153
6.3.1 what is pack 153
6.3.2 create a pack 154
6.4 extended unleash unit 156
6.4.1 tccbigedit and tccemptypanel controls 166
6.4.2 create a composite component 166
6.4.3 create the published attribute of the component 169
6.4.4 considerations for stream attributes 170
6.5 create truly useful components 171
6.6 conclusion 175
Chapter 2 creating components: (2) 7th
7.1 build components from scratch 178
7.2 clock component 180
7.2.1 understand tccclock 189
7.2.2 tcccolorclock 191
7.2.3 create fancy clock 192
7.3 create an icon for the component 195
7.4 tools api: Property editor and component editor 196
7.4.1 five main tools api 196
7.4.2 property editor 196:
7.4.3 more about registering your own components and component editor 199
7.4 component editor 200
7.5 invisible components 201
7.6 findallw program 202
7.6.1 use tfileiterator to traverse directory 213
7.6.2 when should I make the object invisible component 215
7.6.3 alldirs and fileiter 216
7.6.4 traverse directory 216
7.6.5 use findfirst, findnext, and findclose 217.
7.6.6 create an event handler 218
7.7 compdirs program 220
7.8 tccpickdirdlg 226
7.9 component template 231
7.10 ActiveX Control 232
7.11 conclusion 235
Part 3 Database Programming
Chapter 2 fields and database tools 8th
8.1 starting from Relational Database 238
8.1.1 advantage of the relational database model: 239
8.1.2 simple logical settings: Basic 239 of relational databases
8.1.3 indexes and keywords in DBD and Database Explorer 240
8.2 key rule: Create a keyword 243 for each table
8.2.1 one-to-many relationship: Data and index 244
8.2.2 working with primary keywords and primary indexes 245
8.2.3 working with secondary indexes and external keywords 246
8.2.4 keyword importance 246
8.3 use database tools to browse and operate databases 247
8.3.1 browse keywords and indexes of the dbdemos database 247
8.3.2 create an index with Database Desktop 250
8.3.3 create an alias 250
8.3.4 Use Database Desktop to create master and external keywords 251
8.3.5 integrity of inquiry reference 252
8.3.6 relational database and connection 253
8.3.7 connection and QBE 254
8.4 fields editor 255
8.5 calculated field 259
8.6 TDBGrid 260 during running
8.6.1 control the options attribute 263 of DBGrid during running
8.6.2 DBGrid option 264 displayed during running
8.7 use TDBGrid column 265
8.7.1 change tdbgird object title 265
8.7.2 change the entire column of the grid by 266.
8.7.3 change the color of a row in the grid by 267
8.7.4 change the column width by 268
8.7.5 hide column 268 in TDBGrid
8.7.6 display list of visible fields 269
8.7.7 move column 270 during runtime
8.8 search for field 270
8.9 million record objects 276
8.10 conclusion 276
Chapter 2 flat file real-world database 9th
9.1 examples in this Chapter 279
9.2 design applications 279
9.2.1 define data 280
9.2.2 focus of programming 282
9.3 define the appearance of a program 284
9.4 search: process the Category field 286
9.5 set the command structure of the program 287
9.6 view the "rough draft" of the application 289
9.7 create your own object 290
9.8 create the final program 291
9.9 switch to and from read-only mode 309
9.10 sorting data 311
9.11 query data 313
9.12 filter data 314
9.13 mark file 315
9.14 set color 317
9.15 use registry 320
9.16 clipboard: Cut, copy, and paste 323
9.17 conclusion 323
Chapter 1 relational database 10th
10.1 real-world data 324
10.2 test the associated address program 325
10.3 kdadd code 328
10.3.1 use the kdadd program 338
10.3.2 create index 338 for kdadd
10.3.3 query log 339
10.3.4 data insertion and cancellation operations 340
10.3.5 data deletion: Overview of the program's data module 341
10.3.6 data module: cascade deletion 343
10.3.7 data module: general registration 345
10.3.8 add error string 345 to string Resources
10.3.9 about dialog box 346
10.4 use the kdaddexplore program 346
10.4.1 use tsession 347
10.4.2 kdaddexplore program code 349
10.4.3 Display System database 355 with ttreeview
10.4.4 expand ttreeview node 356
10.4.5 Add a list of available tables to ttreeview 356
10.4.6 index and field 358
10.4.7 display alias and alias parameters 359
10.5 conclusion 360
Chapter 4 use local InterBase Server 11th
11.1 starting from Interbase 361
11.1.1 362 database and work Market
11.1.2 set local Interbase 362
11.1.3 set Interbase alias 365
11.2 create a database 366
11.2.1 use wisql 367
11.2.2 create table 367
11.3 use wisql to manage databases 368
11.4 transaction processing 370
11.4.1 create a transact program 370
11.4.2 use the transact program 371
11.4.3 understand transaction processing 372
11.5 cache update 373
11.6 many-to-many relationships 378
11.7 security and InterBase Server Manager 387
11.7.1 Define table access power 388
11.7.2 use InterBase Server Manager to back up table 388
11.8 conclusion 389
Chapter 2 Interbase programming 12th
12.1 music program 391
12.2 design music program 392
12.2.1 database creation solution 393
12.2.2 Modify Table: Empty or non-empty 393
12.2.3 rename the field 394 in the existing table
12.2.4 create blob field 395
12.2.5 primary and external keywords 396
12.3 create an index in the music table 398
12.4 generators, triggers, and stored procedures 399
12.4.1 do not use trigger 400 on the Active Index
12.4.2 use stored procedure 401
12.4.3 stored procedure from Delphi 402
12.5 server-side rules and client-side rules 403
12.6 music program interface overview 404
12.7 use subform 405
12.8 music program code 408
12.8.1 use music program 408
12.8.2 password prohibited: tdatabase object 408
12.8.3 formcreate event 408
12.9 use data in the music program 411
12.10 ask a question to the database: Brief SQL entry 412
12.10.1 Stored Procedure 416 without returning a data set
12.10.2 View data range 417
12.11 conclusion 418
Part 4 com
Chapter 2 COM interface and basics 13th
13.1 understand COM interface 419
13.1.1 what is com? 420
13.1.2 COM and window 420
13.1.3 plug-and-play application 420
13.1.4 com issue 421
13.1.5 the com 422 on UNIX
13.1.6 future 423 of COM + and COM
13.2 interface introduction 423
13.2.1 New Interface Type 423
13.2.2 the interface is not class 424
13.2.3 interface 424 cannot be directly implemented
13.2.4 use a class to implement interface 425
13.2.5 Method for calling an interface 428
13.2.6 destroy interface 429
13.3 theory behind interfaces 432
13.3.1 reason for using the interface 433
13.3.2 maintain or update interface 435
13.4 create and use the COM interface 435
13.4.1 understand the guid 436
13.4.2 about the registry and guid: 437
13.4.3 understand iunknown 440
13.4.4 implement iunknown 445
13.4.5 specify guid 447 for the interface
13.4.6 magic number 448
13.4.7 unknownbyuser program comment 449
13.5 Advanced Interface question 450
13.5.1 more than 451 Interfaces
13.5.2 method parsing statement 454
13.5.3 implements pseudodirective 455
13.5.4 virtual table 458
13.6 conclusion 458
Chapter 2 tcomobject, ttypedcomobject, and Type Library 14th
14.1 sample code 460
14.2 tcomobject 460
14.2.1 place common interface 461 in DLL
14.2.2 iclassfactory 469
14.2.3 isysteminfo interface 470
14.2.4 register the DLL 470
14.2.5 access the COM Object stored in DL from an executable file 471
14.2.6 group data beyond the program boundary 472
14.2.7 group data 473
14.2.8 variant array 473
14.2.9 call isysteminfo 479
14.3 type library and query object 482
14.3.1 create Type Library 483
14.3.2 create a client program for the query type library 488
14.3.3 retrieve itypeinfo 491
14.3.4 obtain Interface Information 494
14.4 conclusion 495
Chapter 4 Create a com automated server and client program 15th
15.1 understand OLE Automation client programs and servers 496
15.2 create a simple COM server and client program 497
15.2.1 building a simple server 497
15.2.2 add method 498 on the server
15.2.3 view the generated source code 499
15.2.4 add interface property 500
15.2.5 create a simple customer program 500
15.2.6 call method 504 through tcominterface
15.2.7 call methods through dispinterface 505
15.2.8 use variant to call method 506
15.3 idispatch, dual interface, and dispinterface 507
15.3.1 call simpleautoserver 508 from word
15.3.2 vtable and dual interface 509
15.4 Type Library 510
15.4.1 what is Type Library 511
15.4.2 create Type Library 511
15.4.2 valid automation type 512
15.5 ignore parameter 512 with emptyparam
15.6 register 513
15.7 Automatic Data grouping 515
15.8 get two or more interfaces from a coclass 515
15.9 conclusion 526
Chapter 2 automation of Word and Excel with Delphi 16th
16.1 system requirements for automated office applications 527
16.2 start Delphi and Excel 528
16.2.1 enable Excel 528
16.2.2 use comobj 529
16.2.3 understanding of simple Excel Automation 530
16.2.4 comparison interface and variant 530
16.2.5 understanding createoleobject 531
16.2.6 variant and type 532
16.2.7 create an automatic Excel Object 532
16.3 Excel automation objects 533
16.3.1 access various objects within the application object 534
16.3.2 use Automation 535
16.4 share charts between Excel and Word 543
16.4.1 create a workbook 546
16.4.2 create a chart 547
16.4.3 use seriescollection object 548
16.5 copy data from Excel to word 550
16.5.1 word internal automation 551
16.5.2 send document 553
16.6 conclusion 553
Part 5 Internet programming
Chapter 2 interfaces and Internet Explorer 17th
17.1 comparison between variant and interfaces 555
17.1.1 remedy interface 556
17.1.2 Type Library 557
17.2 documents required in this chapter 557
17.3 use Word and Excel 558
17.3.1 use Excel and Word interfaces 565
17.3.2 comparison between variant and interface technology 566
17.4 use IE and twebbrowser 568
Start at 17.4.1: access element 568 in web page
17.4.2 processing HTML 574 on the browser at runtime
17.5 place ActiveX controls in the browser 581
17.6 conclusion 588
Chapter 2 webbroker: CGI and ISAPI 18th
18.1 web module 589
18.2 Web Server Application Wizard 589
18.2.1 CGI 590
18.2.2 wincgi 590
18.2.3 ISAPI/nsapi 591
18.2.4 CGI and isapis 591
18.3 webbroker component 591
18.3.1 twebmodule 592
18.3.2 twebresponse 593
18.3.3 twebrequest 593
18.4 intrabob 594
18.5 tpageproducer 596
18.6 tdatasetpageproducer 598
18.7 browsing status 601
18.7.1 faturl 602
18.7.2 cookie 602
18.7.3 implicit field 602
18.8 generation of advanced Web pages 605
18.9 tdatasettableproducer 610
18.10 database Web Application Wizard 613
18.11 tquerytableproducer 613
18.12 conclusion 617
Chapter 2 wininet and FTP 19th
19.1 understand wininet, FTP, and TCP/IP 618
19.1.1 required documents 618
19.1.2 ensure FTP runs 619 IN THE SYSTEM
19.1.3 precautions for installing TCP/IP 619
19.2 use wininet 622 for FTP
19.2.1 use internetopen 624
19.2.2 use internetconnect 624
19.2.3 obtain 626 of the current directory
19.2.4 search for files in the directory (1) 626
19.2.5 search for files in the directory (2) 628
19.2.6 retrieving files (1) 630
19.2.7 create callback 631
19.2.8 retrieving files (ii) 635
19.2.9 simple method of sending files to the server 637
19.2.10 delete file 637
19.2.11 creating and deleting directories 638
19.3 use the FTP control in the program 639
19.3.1 connect to server 647
19.3.2 response to onnewdir event 648
19.3.3 change Directory 648
19.3.4 tracking File Transfer 649
19.4 conclusion 651
Part 6 distributed programming
Chapter 2 DCOM 20th
20.1 COM and distributed architecture 653
Why 1.1 What is DCOM 653
V1.1.2 run DCOM server 95/98 on Windows 654 and Windows NT
1.1.1.3 use Windows 98 656 As a DCOM Server
20.2 simple DCOM client programs and servers 656
Ipv2.1 create server 657
Copyright 2.2 understanding safecall 657
658 data groups between machines
4.1.2.4 create a DCOM client program 662
4.1.2.5 use remote object 670
20.3 re-access the systeminformation program 670
20.4 lightweight remote dataset 677
4.1.4.1 understanding of datacomserver program 685
When 4.2 accessing the remote Dataset
Datacomclient 689
Chapter 4.3 understanding datacomclient 694
4.4 edit data row 696
20.5 program data and automated data 697
20.6 test remote debugging system 702
20.7 conclusion 703
Chapter 4. Das 21st
21.1 multi-layer computing overview 704
21.1.1 what is Midas 705
21.1.2 purpose of distributed computing 706
21.1.3 overview of briefcase model 706
21.1.4 term 707
21.1.5 find the scheduler 707
21.2 technical details: use distributed dataset 708
21.2.1 create a simple Midas application 709
21.2.2 create simplemidasserver 714
21.2.3 understanding server 715
21.2.4 export tprovider interface 715
21.2.5 prepare server 716 for customer applications
21.2.6 create a simple customer program named 717
21.2.7 simple understanding of the customer's procedure of the "money" account 718
21.2.8 remote access server 718
21.2.9 Use SOCKET instead of DCOM 719
21.3 create one-to-multiple applications 720
21.4 create a remote data client application 722
21.4.1 update and refresh data 725
21.4.2 briefcase model 726
21.4.3 packetrecords 727
21.5 error handling 728
21.6 server-side logic and client logic 729
21.7 required DLL 731
21.8 use olenterprise 732
21.9 conclusion 733
Chapter 2 activeform 22nd
22.1 introduction to activeform 735
22.2 create activeform 736
22.3 configured in Internet Explorer
Activeform 736.
22.3.1 set Option 736 for activeform
22.3.2 connect to activeform 737
22.3.3 understand occache 738
22.4 use the cab file and package 739
22.4.1 understand inf file 741
22.4.2 license 742
22.5 run activeform 742 in Word
22.5.1 Register Application 742
22.5.2 run the form 743 in Microsoft Word
22.6 use activeform template 745
22.7 socket and activeform 745
22.7.1 socket overview 745
22.7.2
Midas activeform 746
22.7.3 create an activeform 747 Based on MIDAS
22.8 conclusion 749
Chapter 2 MTS 23rd
23.1 what is MTS 750
23.2 how to install MTS 752
23.3 create a simple MTS server 752
23.4 create a simple MTS client program 758
23.5 call local object 760
23.6 register objects with MTS 761
23.7 Remote Call object 761
23.8 create a simple MTS Database Server 763
23.9 create a simple MTS database client program 770
23.10 process MTS transactions 774
23.11 create an MTS example that spans multiple servers 784
23.12 code 786 of the rocket program
23.13 conclusion 799
Chapter 2 CORBA 24th
24.1 understanding of CORBA 800
24.1.1 what is CORBA 800
24.1.2 comparison between DCOM and CORBA 801
24.1.3 what is orb 802
24.1.4 what is smart agent 803
24.1.5 what's BOA 804
24.1.6 what is proxy, stub and framework 805
24.1.7 understand Delphi and CORBA 807
24.2 two important CORBA repositories 808
24.2.1 what is Interface Repository 808
24.2.2 what is implementation repository 809
24.3 simple CORBA object 809
24.3.1 server 810
24.3.2 customer program 817
24.3.3 understand customer program 819
24.3.4 understanding of CORBA stub 822
24.3.5 understand the CORBA framework 822
24.4 understand the server's IDL Interface 823
24.5 simple CORBA dynamic project 824
24.6 simple CORBA database object 831
24.6.1 create a CORBA database server 831
24.6.2 Create Customer program 840
24.7 use VisiBroker manager and osfind 842
24.8 conclusion 843
Chapter 2 Delphi, Java, and C ++ 25th
25.1 use CORBA 844 in Delphi and Java
25.2 call Java Server from Delphi 851
25.3 call the Delphi CORBA server from C ++ builder 856
25.3.1 use C ++ to create a CORBA server and call 866 from Delphi.
25.3.2 understanding bcbcorbaserver 871
25.4 conclusion 873
Part 7 game programming
Chapter 2 VCL graphics 26th
26.1 Windows GDI and VCL TCanvas 876
26.1.1 understanding of the GDI 876
26.1.2 VCL makes graphical programming easier by 877
26.2 use TCanvas 877
26.3 research and use of painter 878
26.3.1 tbrush. Color Attribute Analysis 878
26.3.2 tbrush. Style attribute analysis 878
26.3.3 Analysis of tbrush. Assign Method 880
26.4 research and use of paint brush 881
26.4.1 attributes analysis of tpen. Style 881
26.4.2 analysis of the tpen. Width attribute 881
26.4.3 Analysis of tpen. Mode attributes 881
26.5 research and use of fonts 883
26.5.1 tfont. Height attribute analysis 883
26.5.2 tfont. Size attribute analysis 883
26.5.3 tfont. Name attribute analysis. 884
26.5.4 tfont. Style attribute analysis 884
26.6 research and use of TCanvas. penpos 884
26.7 research and use of TCanvas. cliprect 884
26.8 research and use of TCanvas. copymode 885
26.9 research and use of TCanvas. pixels 886
26.10 analyze and understand the TCanvas method 886
26.11 mainbrush sample code 886
26.11.1 oncreate event 895
26.11.2 formshow method 896
26.11.3 set paint brush mode 897
26.11.4 use the fonts 898
26.11.5 draw a 899 shape on the canvas
26.11.6 use copymode 902.
26.11.7 modify cliprect 902
26.12 lines with other names 903
26.13 in-depth research on VCL 906
26.13.1 learn more about tcolor 906
26.13.2 colors sample project 907
26.13.3 onchange event handler 909
26.14 palette 910
26.15 learn more about Windows graphics file formats 910
26.15.1 analyze bitmap and DiB 910
26.15.2 analysis icon 911
26.15.3 analysis metadata 912
26.16 analyze tpaintbox and timage 915
26.17 review bitmap 916
26.18 conclusion 923
Chapter 2 DirectDraw 27th
27.1 understand DirectDraw 924
27.1.1 what is DirectDraw 925
27.1.2 thoughts on double buffering 926
27.1.3 hardware and simulation 927
27.2 a simple DirectDraw program 928
27.3 release API 934
27.3.1 enter the exclusive mode and change the screen resolution by 935
27.3.2 what is the DirectDraw surface? 935
27.3.3 write text 937 to the screen
27.3.4 exchange surface 938
27.3.5 release memory 939
27.4 smooth animation 940
27.5 use bitmap 949
27.6 game resources 955
27.7 conclusion 956
Chapter 2 more DirectX technologies 28th
28.1 directsound 957
28.1.1 initialize directsound 958
28.1.2 enumeration sound driver 961
28.1.3 use directsoundbuffer 962
Open WAV file 964
28.1.5 play audio file 966
28.1.6 play large files 967
28.1.7 play two WAV Files 967 at a time
28.2 create DirectX game 968
28.2.1 create the delphiman program 970
28.2.2 precautions for implementing the delphiman program 979
28.2.3 "machine Character" control 982
28.2.4 summary delphiman program 982
28.3 view direct3d 982
28.4 key 3D technologies 983
28.5 conclusion 984
Supporting Cd content 986