1. Trang chủ
  2. » Công Nghệ Thông Tin

Ivor Horton’s Beginning Visual C++ 2005 phần 1 ppsx

123 339 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 123
Dung lượng 2,13 MB

Nội dung

[...]... 12 4 12 5 12 5 12 6 12 7 12 9 13 2 13 2 13 2 13 5 13 9 14 3 14 3 14 6 14 7 15 0 15 3 15 6 15 7 15 9 16 0 16 0 16 1 16 4 16 6 16 7 16 9 17 0 Indirect Data Access 17 2 What Is a Pointer? Declaring Pointers 17 2 17 3 The Address-Of Operator Using Pointers The Indirection Operator Why Use Pointers? Initializing Pointers Pointers to char The sizeof Operator Constant Pointers and Pointers to Constants xvi 17 3 17 4 17 4 17 4 17 6 17 7 18 1 18 3... ID Initiating ID Creation Storing the Order Data Setting Dates Selecting Products for an Order Adding a New Order Summary Exercises xxxii 9 91 992 993 994 996 997 999 10 00 10 01 1002 10 02 10 06 10 10 10 14 10 14 10 15 10 17 10 19 10 20 10 21 1023 10 28 10 29 Contents Chapter 21: Applications Using Windows Forms Understanding Windows Forms Understanding Windows Forms Applications Modifying the Properties of a Form... 10 35 10 35 10 36 10 37 10 38 10 40 10 42 10 44 10 47 10 48 10 49 10 49 10 50 10 50 10 52 10 56 10 56 10 58 10 60 10 61 10 61 1062 10 63 10 67 10 68 Getting the Data from the Dialog Controls Disabling Input Controls Updating the Limits Menu Item Handlers 10 70 10 73 10 74 Implementing the Help | About Menu Item Handling a Button Click Responding to the Context Menu 10 75 10 76 10 79 The Logic for Dealing with the Choose Menu Item... Namespaces C++/ CLI Programming 78 79 80 81 81 82 84 85 86 86 88 88 91 91 94 95 96 98 99 C++/ CLI Specific: Fundamental Data Types C++/ CLI Output to the Command Line C++/ CLI Specific — Formatting the Output C++/ CLI Input from the Keyboard Using safe_cast C++/ CLI Enumerations 99 10 4 10 4 10 7 10 8 10 9 Specifying a Type for Enumeration Constants Specifying Values for Enumeration Constants 11 1 11 1 Summary Exercises... Function Function Prototypes Passing Arguments to a Function The Pass-by-value Mechanism Pointers as Arguments to a Function 18 5 18 5 19 0 19 1 19 2 19 2 19 3 19 4 19 6 19 7 19 7 19 7 19 8 19 9 19 9 200 205 206 209 213 216 217 220 222 225 225 228 230 2 31 232 233 233 233 234 235 235 235 239 240 2 41 xvii Contents Passing Arrays to a Function Passing Multi-Dimensional Arrays to a Function References as Arguments to a Function... Form1 Class Handling the Play Menu Event Handling Events for the Limits Menu Creating a Dialog Box Adding a List to a ListBox Handling the Dialog Button Events Controlling the State of the ListBox Objects Creating the Dialog Object Using the Dialog Box Validating the Input Handler the Reset Menu Item Event Adding the Second Dialog 10 31 10 31 1032 10 34 10 35 10 35 10 36 10 37 10 38 10 40 10 42 10 44 10 47 10 48 10 49... 898 899 9 01 9 01 903 904 906 906 906 906 906 907 907 907 908 908 910 911 912 913 914 915 916 917 917 918 920 920 Contents Chapter 19 : Connecting to Data Sources Database Basics A Little SQL Retrieving Data Using SQL Choosing Records 9 21 9 21 924 924 925 Joining Tables Using SQL Sorting Records 926 929 Database Support in MFC 929 MFC Classes Supporting ODBC 930 Creating a Database Application 9 31 Registering... if-else Statements 11 2 11 3 11 5 11 5 11 7 11 8 12 0 12 2 xv Contents Logical Operators and Expressions Logical AND Logical OR Logical NOT The Conditional Operator The switch Statement Unconditional Branching Repeating a Block of Statements What Is a Loop? Variations on the for Loop Using the continue Statement Floating-Point Loop Counters The while Loop The do-while Loop Nested Loops C++/ CLI Programming... 700 7 01 703 703 704 705 xxv Contents Chapter 14 : Drawing in a Window 707 Basics of Drawing in a Window 707 The Window Client Area The Windows Graphical Device Interface What Is a Device Context? Mapping Modes The Drawing Mechanism in Visual C++ The View Class in Your Application The OnDraw() Member Function The CDC Class Displaying Graphics Drawing in Color 708 709 709 709 711 711 711 712 713 717 Drawing... Classes Generic Classes Generic Interface Classes Generic Collection Classes Summary Exercises xxii 482 486 489 490 495 496 496 497 499 5 01 503 504 505 505 508 511 516 516 520 520 526 527 5 31 5 31 5 31 536 536 537 537 5 41 545 549 5 51 554 555 5 61 562 Contents Chapter 10 : Debugging Techniques Understanding Debugging Program Bugs Common Bugs Basic Debugging Operations Setting Breakpoints Advanced Breakpoints . Ivor Horton’s Beginning Visual C++ ® 2005 Ivor Horton 01_ 5 719 74 ffirs.qxp 1/ 20/06 11 :22 PM Page iii 01_ 5 719 74 ffirs.qxp 1/ 20/06 11 :22 PM Page ii Ivor Horton’s Beginning Visual C++ ® 2005 01_ 5 719 74. C++ ® 2005 01_ 5 719 74 ffirs.qxp 1/ 20/06 11 :22 PM Page i 01_ 5 719 74 ffirs.qxp 1/ 20/06 11 :22 PM Page ii Ivor Horton’s Beginning Visual C++ ® 2005 Ivor Horton 01_ 5 719 74 ffirs.qxp 1/ 20/06 11 :22 PM Page iii Ivor Horton’s. Constants 11 1 Summary 11 2 Exercises 11 3 Chapter 3: Decisions and Loops 11 5 Comparing Values 11 5 The if Statement 11 7 Nested if Statements 11 8 The Extended if Statement 12 0 Nested if-else Statements 12 2 02_5 719 74

Ngày đăng: 13/08/2014, 18:20