Answers in the development of Visual C ++ development

xiaoxiao2021-03-06  38

1. Briefly describe how the program is debugging under the main menu "build", there is a submenu of Start Build, which contains the GO menu (shortcut to F5), after selecting, the program will enter debug from the current statement Run until the breakpoint or the end of the program is encountered. Move the mouse to the code row to be debugged, click the right mouse button to select "Insert / Remove Breakpoint", or press F9, you can add a breakpoint on that line, at which point the breakpoint code line appears a brown circle, once again Select will clear the breakpoint. After entering the debug state, the Debug menu will replace the build menu in the menu bar, which contains common debugging operations, such as Step over, single-step running does not track the inside of the call to the call; other include Step Into, Step Out, Stop Debugging and other debugging methods. 2. What is the role of a file in the project buff in VC6 established in VC6? H., .r.r, .s. .. .cpp is the source code C file .h is included in the content declaration and variable definition The header file .RC is the resource script file for defining the resource. DSP is an engineering file, record the information about the current project. DSW is a workspace file, a work area may contain one or more projects 3, known a dialog A editing box control, ID is IDC_EDIT1, which is associated with the CEDIT type variable m_edit1, using two methods, explaining how the text inside the edit box is "Hello", and the segment of the program code is written. The first method: m_edit1.setsel (0, -1); m_edit1.replasel ("Hello"); second method: setWindowText ("Hello"); 4, a basic Windows application written in WINDOWS API The structure of the program framework. The Basic Application Framework written by the Windows API should contain at least the program portable function WinMain and window functions WndProc. In the main function WinMain, the definition and registration of the window class, the creation and display of the window, and the message loop. 5, what is the data type in Windows, what is the member variable, what a message has a data type of message is MSG, it is a structure, its member variable mainly includes hwnd, indicating the window handle of the message; Message representative The type of message; WPARAM and LPARAM include additional information for messages, different messages. 6, long parameter of Windows LPARAM and word parameter WPARAM is what mouse message long parameter lParam's low byte contains the X coordinate value of the mouse cursor position, and the high byte of LParam contains the yogue of the mouse cursor position. Y Coordinate values; word parameter WPARAM contains values ​​indicating the currently pressed virtual key status. 7. Note that the Note Problem using a non-modular dialog and uses a non-modular dialog box to use a non-modular dialog box to note must be displayed normally in the style; create a dialog using the createDialog function; message loop section You should use IsDialogMessage filtering messages; close the dialog uses the function destroywindow. 8. Briefly describe the role of Updatedata functions in the MFC application and its parameters. Updatedata has only one BOOL type parameter, Updatedata (false) is typically used for variable value refresh screen displays for dialog control connections; Updatedata (TRUE) is used to obtain the variables of the screen data to the dialog control connection.

9, list the three message types that the list box control can be accepted, and the LB_ADDString is used to add a string in the list box; lb_dir is used to list the specified file in the list box; LB_GETTEXT is used to get the specified item text. 10. Add three radio buttons on a dialog to automatically implement mutual exclusion, what questions should be paid, how to operate in the VC environment? To implement a set of automatic mutual exclusion of a set of radio buttons, they should let their control ID values ​​continuous, and set the Group properties of the first radio button, other no. 11. Briefly describe a document class by a document class, and how to achieve documentation. First, a corresponding document class is derived from cDocument from cDocument; then adds a member variable to save the data; finally overloads the Serialize member function to realize serialization of document data. 12, list three subclasses of the view class (CVIEW) and briefly explain its role. The CScrollView class provides scrolling display of the view; the CeditView class supports the text editing operation in the view; the ChtmlView class supports displaying and operating an HTML file in the view. 13, how Visual C 6.0 enters the debug state, which debug window can be displayed in debug state, list three, what is its role? After start debugging, you can open some auxiliary debugging window under the Debug Window submenu of the View menu. WATCH: Displaying the window Call Stack in the current statement and the previous statement: Display the window Memory to see the calling stack: Display the window 14 of the content in memory, explain the steps of the creation of bitmap resources, and give the corresponding Windows API function name. First define bitmap handle hbitmap hbitmap; second step using loadbitmap load bitmap; Step 3, call CreateCompaTibleDC to apply for a memory device environment handle to the system, and call the function SelectObject to select the bitmap to the memory device environment; fourth step, call Bitblt The function outputs the bitmap from the memory device environment to the specified window device environment, which implements the display bitmap. 15. How to get the font handle to implement the output of the font, and give the corresponding Windows API function name. First define the font handle variable HFONT HF; then call the function getStockObject to get the font handle of the system, or call CREATEFON to get a custom font handle; finally call SelectObject to select the font handle to the device environment. 16, list three types of buttons, and explain the differences between its roles and creation methods. Common buttons have normal buttons, radio buttons, check boxes, and group boxes. The normal button effect is to help users trigger a specified action; the radio button is generally mousse between options; the checkbox is used to display a set of options for user selection, and there is no mutual exclusion between options; Divide the control into a different group and explain. 17. To make a static control display a bitmap and accept user input, what is the problem should be paid. To make the static control display bitmap, you must set the style containing SS_bitmap, and specify and load the bitmap when creating a static control window, that is, calling CREATEWINDOW; to make the static control to receive user input, you must set its style to include SS_NOTIFY. 18, list the four types of action identity of the scroll bar control, and explain the occasions of it. The action identifier of the commonly used scroll strip control includes (for a vertical scroll bar): SB_LineUp indicates the rolling row; SB_Linedown indicates a row down; SB_PAGEUP indicates the upward scroll; SB_PageDown means scrolling one page down.

19. Note that the method of using the system timer message (WM_TIMER) and its use of the Windows API function using the timer message is: first call the setTimer function definition timer message, including the time interval generated by the message; then in the corresponding The timer message response code is added to the WM_TIMER message processing; finally calls KillTimer to release the timer. 20. The MFC Application Wizard can create several types of application frameworks that use document / view structures. The MFC application wizard can establish a single document (SDI), multi-Document (MDI), and dialog-based frameworks for the Dialog Based. The first two use document / view structures. 21, listing five controls, indicating that the role and the CSTATIC corresponding to the MFC is a static text control window, used for other controls in the label, separated dialog, or window; CButton is a button control window, a dialog or window Buttons, radio buttons, and multi-selection buttons, etc. provide a total class; cscrollbar is the scroll bar control window, providing the function of the scroll bar, and is used in a control in the dialog or window, and is positioned within some range; Clistbox is a list box control window, which is used to display a list of list items. The user can observe and select; CProgressCtrl is a progress bar control window for indicating an operation. 22. How does the MFC document / view structure explain how the map class accesses the document class, how the document class notifies the view class to update, give the member method name? In the document / view structure of the MFC, the view class obtains the corresponding document class by its member method getDocument, thereby accessing the document class data; document classes notify all views through their membership updateAllViews, the document has been modified, the view should be redrawn . 23. Briefly describe an editing box in a dialog-based MFC application frame (edit the control ID is IDC_EDIT1, which has been connected to the variable m_edit1), requires that the current display shows the current time, time format " HH: mm: ss ", such as" 15:20:16 ", refresh every second, how to implement, give the code snippet. (Tip: Using Timer SetTimer) Implementation Method: Implement the timer, send a WM_TIMER message every other second, and add the code update edit box in the message corresponding function. Step 1: Add code to the message response function on the WM_INITDIALOG of the dialog: Settimer (1,100, null); Step 2: Add WM_TIMER's message to the dialog, TNW; CTIME TNOW; TNOW = CTIME :: getCurrentTime (); cstring snow = T1ow.format ("% i:% m:% s"); m_edit1.setsel (0, -1); m_edit1.replasel (snow);

Step 2: Add code KillTimer (1) to the message response function on the WM_DESTRYOY of the dialog.

转载请注明原文地址:https://www.9cbs.com/read-58133.html

New Post(0)