⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vcg16.htm

📁 Visual C++与数据库的连接经典实例
💻 HTM
📖 第 1 页 / 共 5 页
字号:
Tells the container not to automatically change the control's state. Selecting Passive Container Mode automatically deselects Simulated Design Mode.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Simulated Design Mode

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Tells the container to automatically change the control's state. Selecting Simulated Design Mode automatically deselects Passive Container Mode.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Freeze Events

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Freezes or releases the on-event firing for all controls.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Honor ACTIVEATEWHENVISIBLE

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Turns support on or off for the OLEMISC_ACTIVATEWHENVISIBLE flag.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Honor INVISIBLEATRUNTIME

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Turns support on or off for the OLEMISC_INVISIBLEATRUNTIME flag. This option is supported only by TSTCON16.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Help

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Contents

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Provides help on Test Container by displaying the Contents help page.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

About Test Container

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays Test Container's About box.</FONT>

</TABLE></CENTER><P>Test Container also has a customized status bar that provides information about the currently selected control and Test Container. The following is a list of the panes in the status bar from left to right:

<BR>

<UL>

<LI>Test Container's Status: Provides menu prompts and Test Container's general status.

<BR>

<BR>

<LI>OLE Control Name: The name of the currently selected control is displayed in the second pane. If there is no currently selected control, this pane is blank.

<BR>

<BR>

<LI>OLE Control Count: Test Container keeps a count of how many instances of each control type are currently loaded. This pane displays the count for the currently selected control. For example, if you load three copies of the digital clock control, the Count pane will be either 01, 02, or 03, depending on which copy of the digital clock control is currently selected. If no control is currently selected, this pane is blank.

<BR>

<BR>

<LI>OLE Control UI Status: The pane on the far right provides the status of the currently selected control. To change the control's UI status, select Edit | Embedded Object Functions. If no control is currently selected, this pane is blank.

<BR>

<BR>

</UL>

<P>Figure 16.6 shows Test Container's main window and its client area with the calendar custom control. Notice how the calendar looks in Test Container. This is almost exactly how it would appear when embedded into an application.

<BR>

<P><B><A HREF="16vcg06.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/16vcg06.gif">Figure 16.6. Test Container's main window, with Access 7's calendar control loaded.</A></B>

<BR>

<P>Test Container also provides a dialog box to configure the logging of events, as shown in Figure 16.7. You can tell Test Container which events you want to log (see the description of the Event Log that follows). You can select each event and choose to have it logged or not logged. Also, there are buttons to turn event logging on or off for all events. Compare the events shown in Figure 16.7 with the Event Log window shown in Figure 16.8 (Test Container's logging windows).

<BR>

<P><B><A HREF="16vcg07.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/16vcg07.gif">Figure 16.7. Test Container's Events for... dialog box.</A></B>

<BR>

<P><B><A HREF="16vcg08.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/16vcg08.gif">Figure 16.8. Test Container's logging windows.</A></B>

<BR>

<P>With Test Container's status windows, you can see the OLE control's Event Log and Notification Log. Both the Event Log and the Notification Log dialog boxes are modeless and can be left displayed for the entire Test Container session.

<BR>

<P>The Event Log window shows the events for the currently active control. For example, the Circ3 control posts events for mouse clicks, both inside and outside the circle. For mouse clicks inside the circle, the event routines are configured to show the relative coordinates of the mouse cursor.

<BR>

<P>The Notification Log window notifies you of changes in the controls' properties. Figure 16.9 shows the notifications received when the Calendar control has had its Today property changed.

<BR>

<P><B><A HREF="16vcg09.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/16vcg09.gif">Figure 16.9. Test Container's Notification Log with changes to Calendar.</A></B>

<BR>

<P>Also part of the Notification Log dialog box are radio buttons to configure the response to the OnRequestEdit() call. Choices include the following:

<BR>

<UL>

<LI>Always Allow Changes: The response to the OnRequestEdit() call will be yes.

<BR>

<BR>

<LI>Never Allow Changes: The response to the OnRequestEdit() call will be no.

<BR>

<BR>

<LI>Ask Each Time: The user is shown a confirmation dialog box that lets him decide whether it's OK to change the property. If he selects Yes, the property is changed. If he selects No, the property isn't changed.

<BR>

<BR>

</UL>

<BR>

<A NAME="E69E215"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>WPS</B></FONT></CENTER></H4>

<BR>

<P>WPS is a utility&#151;part of the 16-bit version of the CDK (supplied with Visual C++ 1.5x and found on the MSDN Level I CD)&#151;that lets you view both running tasks and loaded modules. You can perform a number of functions with WPS, such as freeing a task or a module, saving the list of currently running tasks and loaded modules in a file, or forcing the loading of a module. Although this utility is intended for use with Windows 3.x, it will run under Windows 95.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE><B>NOTE</B>

<BR>

<BR>Programmers using Windows 95 should use the PView95 utility instead of WPS. PView95 works in the same manner as Windows NT's PView program.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>Programmers who are developing OLE controls can use WPS in several ways. First, when a container program (such as Access) uses an OLE control, the container program won't unload the control when the control terminates. You can't make changes to a DLL file while it's loaded, so you must force Windows to unload the DLL before rebuilding it with Visual C++.

<BR>

<P>As a side benefit, WPS is useful as both a general process viewer and as a method to delete an undesirable process.

<BR>

<P><B>WARNING</B>

<BR>

<BR>As with any system-level utility, WPS can bring Windows to a screeching halt. If you free a module or task that Windows needs to run, the world as Windows knows it will come to an end. Processes and tasks to steer clear of include those that have the names <I>kernel</I> and <I>KRNL,</I> as well as other names that you can associate with the Windows system components.

<P>WPS presents itself as a window split horizontally into two unequal parts. Processes appear in the top third of the window, and loaded modules appear in the lower two-thirds. One small flaw is that you can't change the size of the two parts of the window.

<BR>

<P>WPS offers several menus, which are listed in Table 16.3.

<BR>

<BR>

<P ALIGN=CENTER>

<CENTER>

<FONT COLOR="#000080"><B>Table 16.3. WPS menu options.</B></FONT></CENTER>

<BR>



<CENTER><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Menu</I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Option</I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Description</I>

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

File

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Load Module...

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Lets you force the loading of a module (an .EXE or a .DLL file).

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Dump

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Lets you save the main window's contents in a standard text file format. The saved file's contents can then be reviewed later.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

About WPS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Displays the About dialog box, giving the authors' names and their company.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Exit

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Ends the current WPS session.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Options

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Free Module

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Frees the module that is currently selected.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Free Task

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Frees the task that is currently selected.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Font

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Lets you change the font that WPS uses. Selecting a smaller font lets you display more lines of information.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Edit

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Copy

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Copies the contents of the WPS window to the clipboard.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Update!

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>



<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Tells WPS to update its display.</FONT>

</TABLE></CENTER><P>Figure 16.10 shows WPS running on a system. Notice that there are more tasks running than will fit into the Tasks part of the window (the top part), and many more modules loaded than will fit into the Modules part (the bottom part). However, because both of these lists are sorted by name, it isn't difficult to find a specific task or module.

<BR>

<P><B><A HREF="16vcg10.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/16vcg10.gif">Figure 16.10. WPS's main window.</A></B>

<BR>

<P>When you look at Figure 16.10 you can see several columns. Table 16.4 describes the columns and how they're used.

<BR>

<BR>

<P ALIGN=CENTER>

<CENTER>

<FONT COLOR="#000080"><B>Table 16.4. Columns in WPS.</B></FONT></CENTER>

<BR>



<CENTER><TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Column</I>

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Description</I>

</FONT>

<TR>

<TD COLSPAN=2 ALIGN=center  VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

<I>Tasks Section</I>

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Name

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

The name of the running task. Generally, this is the eight-character program name. Often it's the same as the task's eight-character filename.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

hTask

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

The handle for the task (see hParent).

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

hParent

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

The hTask for the parent task of this task. If the parent task is zero, the task is a 32-bit task owned by Windows.

</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

nEvents

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

The count of the hardware resources (such as communications ports) for the task.

</FONT>

<TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -