📄 apa.htm
字号:
<DD><B>10. </B>What is a BDE alias? <P> <DT></DT> <DD>A set of parameters that describes a database connection. <P></DL><H1><A NAME="HeadingA"></A>Day 17</H1><DL> <DT></DT> <DD><B>1. </B>What's the fastest and easiest way to create a database form? <P> <DT></DT> <DD>With the Database Form Wizard. <P> <DT></DT> <DD><B>2. </B>How do you control the order and number of columns that appear in a DBGrid component? <P> <DT></DT> <DD>With the Columns Editor. (Right-click a DBGrid component and choose Columns Editor from the context menu.) <P> <DT></DT> <DD><B>3. </B>What component enables you to display a dataset in table format? <P> <DT></DT> <DD>The DBGrid component. <P> <DT></DT> <DD><B>4. </B>How can you add or remove buttons from a DBNavigator? <P> <DT></DT> <DD>By modifying the VisibleButtons property. <P> <DT></DT> <DD><B>5. </B>What component do you use to display BLOB image data? <P> <DT></DT> <DD>The DBImage component. <P> <DT></DT> <DD><B>6. </B>What property is common to all data-aware components? <P> <DT></DT> <DD>The DataSource property (among others). <P> <DT></DT> <DD><B>7. </B>What property is used to select the field that a data component is linked to? <P> <DT></DT> <DD>The DataField property. <P> <DT></DT> <DD><B>8. </B>Can you rearrange the columns in a DBGrid component? <P> <DT></DT> <DD>Yes. Use the Columns Editor at design time or drag and drop them at runtime. <P> <DT></DT> <DD><B>9. </B>Which component is used to edit and display text fields in a database? <P> <DT></DT> <DD>The DBEdit component. <P> <DT></DT> <DD><B>10. </B>What does BLOB stand for? <P> <DT></DT> <DD>Binary large object. <P></DL><H2><A NAME="Heading16"></A>Day 18</H2><DL> <DT></DT> <DD><B>1. </B>What method do you call to create a database table at runtime? <P> <DT></DT> <DD>CreateTable. <P> <DT></DT> <DD><B>2. </B>What does the Edit method of TTable do? <P> <DT></DT> <DD>The Edit method puts the dataset in edit mode so that records can be modified. <P> <DT></DT> <DD><B>3. </B>What method do you call when you want to apply the changes made to a record? <P> <DT></DT> <DD>The Post method. <P> <DT></DT> <DD><B>4. </B>How do you create a new data module? <P> <DT></DT> <DD>Through the Object Repository. <P> <DT></DT> <DD><B>5. </B>Is a data module a regular form? <P> <DT></DT> <DD>A data module is very similar to a regular form but not the same. <P> <DT></DT> <DD><B>6. </B>What method do you call to print a QuickReport? <P> <DT></DT> <DD>The Print method. <P> <DT></DT> <DD><B>7. </B>What type of QuickReport band displays the dataset's data? <P> <DT></DT> <DD>A detail band. <P> <DT></DT> <DD><B>8. </B>What component is used to display the page number on a report? <P> <DT></DT> <DD>The QRSysData component can display page numbers, the current date, the current time, and more. <P> <DT></DT> <DD><B>9. </B>How can you preview a report at design time? <P> <DT></DT> <DD>Right-click the report and choose Preview from the context menu. <P> <DT></DT> <DD><B>10. </B>What is the QRExpr component used for? <P> <DT></DT> <DD>The QRExpr component is used to display the results of an expression (usually a calculated result). <P></DL><H2><A NAME="Heading17"></A>Day 19</H2><DL> <DT></DT> <DD><B>1. </B>How do you load a DLL using static loading? <P> <DT></DT> <DD>In your calling application declare any functions or procedures contained in the DLL using the extern keyword. The DLL will automatically load when the application starts. <P> <DT></DT> <DD><B>2. </B>How do you load a DLL using dynamic loading? <P> <DT></DT> <DD>Use the Windows API function LoadLibrary. <P> <DT></DT> <DD><B>3. </B>How do you call a function or procedure from a DLL that has been loaded statically? <P> <DT></DT> <DD>Call the function or procedure just as you would call a regular function or procedure. <P> <DT></DT> <DD><B>4. </B>What steps do you have to take to ensure that a function or procedure in your DLL can be called from outside the DLL? <P> <DT></DT> <DD>The function or procedure must be exported from the DLL. Place the function or procedure name in the exports section of the DLL. <P> <DT></DT> <DD><B>5. </B>In the case of a DLL that has been dynamically loaded, can you unload the DLL at any time or only when the program closes? <P> <DT></DT> <DD>You can unload the DLL any time you want (using the FreeLibrary function). <P> <DT></DT> <DD><B>6. </B>What must you do to display a Delphi form contained in a DLL from a non-Delphi program? <P> <DT></DT> <DD>Create an exported function that the calling application can call. In this function, create the form and display it. Be sure the function is declared with the stdcall keyword. <P> <DT></DT> <DD><B>7. </B>What is the name of the keyword used to declare functions and procedures imported from a DLL? <P> <DT></DT> <DD>The external keyword. <P> <DT></DT> <DD><B>8. </B>How do you add resources to a DLL? <P> <DT></DT> <DD>Link a compiled resource file (.res or .dcr) to the DLL with the $R compiler directive--for example, <P></DL><BLOCKQUOTE> <PRE>{$R Resources.res}</PRE></BLOCKQUOTE><PRE></PRE><DL> <DT></DT> <DD><B>9. </B>Does a resource DLL need to contain code as well as the resources? <P> <DT></DT> <DD>No. A resource DLL doesn't need any code. <P> <DT></DT> <DD><B>10. </B>Can a DLL containing resources be loaded statically (when the program loads)? <P> <DT></DT> <DD>It's possible, but there's rarely any reason to load a resource DLL statically. You need the return value from LoadLibrary to access resources in the DLL, so you might as well use dynamic loading for resource DLLs. <P></DL><H2><A NAME="Heading18"></A>Day 20</H2><DL> <DT></DT> <DD><B>1. </B>Must a property use a write method? Why or why not? <P> <DT></DT> <DD>No. You can use direct access instead. <P> <DT></DT> <DD><B>2. </B>Must a property have an underlying data field? Why or why not? <P> <DT></DT> <DD>No, a property doesn't have to have an underlying data field, but most properties usually do. A property that doesn't store a value is unusual. <P> <DT></DT> <DD><B>3. </B>Can you create a component by extending an existing component? <P> <DT></DT> <DD>Absolutely. That's the easiest way to create a new component. <P> <DT></DT> <DD><B>4. </B>What happens if you don't specify a write specifier (either a write method or direct access) in a property's declaration? <P> <DT></DT> <DD>The property becomes read-only. <P> <DT></DT> <DD><B>5. </B>What does direct access mean? <P> <DT></DT> <DD>The underlying data member for the property is modified and/or read directly (no read method and no write method). <P> <DD><B>6. </B>Must your properties have a default value? Why or why not? <DT></DT> <DD>No, default values for properties are optional. Published properties should have a default value, though. Properties that are string properties cannot have a default value (and some other types of properties as well). <P> <DT></DT> <DD><B>7. </B>Does the default value of the property set the underlying data field's value automatically? <P> <DT></DT> <DD>No, the default value only displays a value in the Object Inspector at design time. You must set the underlying data member to the default value in the component's constructor. <P> <DT></DT> <DD><B>8. </B>How do you install a component on the Component Palette? <P> <DT></DT> <DD>Choose Component | Install from the main menu. <P> <DT></DT> <DD><B>9. </B>How do you specify the button bitmap that your component will use on the Component Palette? <P> <DT></DT> <DD>Create a .dcr file with the same name as the component's source. The .dcr should contain a 24¥24 bitmap with the same name as the component's classname. Be sure that the .dcr is in the same directory as the .pas file for the component. <P> <DT></DT> <DD><B>10. </B>How do you trigger a user-defined event? <P> <DT></DT> <DD>Just call the event after checking whether an event handler exists for the event: <P></DL><BLOCKQUOTE> <PRE>if Assigned(FOnMyEvent) then</PRE> <PRE> FOnMyEvent(Self);</PRE></BLOCKQUOTE><PRE></PRE><H2><A NAME="Heading19"></A>Day 21</H2><DL> <DT></DT> <DD><B>1. </B>Do Delphi and C++Builder project files have the same filename extension? <P> <DT></DT> <DD>No, Delphi and C++Builder project files do not have the same filename extension. Delphi projects have a .dpr extension and C++Builder projects have a .bpr extension. <P> <DT></DT> <DD><B>2. </B>Do Delphi and C++Builder form files have the same filename extension? <P> <DT></DT> <DD>Yes. Both Delphi and C++Builder have .dfm filename extensions. <P> <DT></DT> <DD><B>3. </B>Can you use packages from third-party component vendors in both Delphi and C++Builder? <P> <DT></DT> <DD>In most cases, you can use packages from third-party component vendors in both Delphi and C++Builder. In some cases, the packages will have to be rebuilt with C++Builder. Ask the component vendor for packages compatible with C++Builder. <P> <DT></DT> <DD><B>4. </B>Can you open a Delphi form file in C++Builder? <P> <DT></DT> <DD>Yes. You cannot edit the form (add or remove components), but you can view the form. <P> <DT></DT> <DD><B>5. </B>Can you edit a Delphi form file using the C++Builder Form Designer? <P> <DT></DT> <DD>No, you cannot edit a Delphi form file using the C++Builder Form Designer. However, you can edit the Delphi form as text by choosing View As Text from the C++Builder context menu. <P> <DT></DT> <DD><B>6. </B>Can you use a C++Builder source unit in Delphi? <P> <DT></DT> <DD>With the current version of Delphi, you cannot use a C++Builder source unit in Delphi. <P> <DT></DT> <DD><B>7. </B>Which is better, Delphi or C++Builder? <P> <DT></DT> <DD>Neither Delphi or C++Builder is better. Both have their strengths. It depends largely on whether you prefer Pascal or C++. <P></DL><H2><A NAME="Heading20"></A>Bonus Day</H2><DL> <DT></DT> <DD><B>1. </B>What control do you use to display Web pages? <P> <DT></DT> <DD>The THMTL control. <P> <DT></DT> <DD><B>2. </B>What control do you use to connect to newsgroups? <P> <DT></DT> <DD>The TNMNNTP control. <P> <DT></DT> <DD><B>3. </B>What is the name of the method used to display an HTML document with the THTML control? <P> <DT></DT> <DD>RequestDoc. <P> <DT></DT> <DD><B>4. </B>What event is generated when an HTML document has completed loading? <P> <DT></DT> <DD>The OnEndRetrieval event. <P> <DT></DT> <DD><B>5. </B>What control do you use to send email messages? <P> <DT></DT> <DD>The TNMSMTP control. <P> <DT></DT> <DD><B>6. </B>What control do you use to retrieve email messages? <P> <DT></DT> <DD>The TNMPOP3 control. <P> <DT></DT> <DD><B>7. </B>What is the name of the method used to send mail with the TNMSMTP control? <P> <DT></DT> <DD>SendMail. <P> <DT></DT> <DD><B>8. </B>Can you freely distribute the Internet Explorer ActiveX control? <P> <DT></DT> <DD>No, you must obtain a license from Microsoft to distribute the Internet Explorer ActiveX control. <P> <DT></DT> <DD><B>9. </B>What is the name of the utility used to register ActiveX controls? <P> <DT></DT> <DD>TREGSVR.EXE. <P> <DT></DT> <DD><B>10. </B>What company provides the bulk of the Internet controls that come with Delphi? <P> <DT></DT> <DD>NetMasters.</DL><H1></H1><CENTER><P><HR><A HREF="../ch21/ch21.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../apb/apb.htm"><IMGSRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> </P><P>© <A HREF="../copy.htm">Copyright</A>, Macmillan Computer Publishing. Allrights reserved.</CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -