Page 1 of 1

Help

Posted: Sat Dec 04, 2004 9:20 pm
by Anonymous
This is my first step to learn MFC,when i do the exercise,so many difficult problems puzzled me.Even more,the book doesn't have any keys.I am quite at sea now,so i wish a good sort could help me.Sincerely thanks!



1. Your company manages inventory with a software package that was

developed in-house by using Visual C++ and MFC. Changes to government

regulations have led your company's Information Technology department

to develop a new version of the package. This new version will replace

the older version entirely. The new version will generate the same

reports that the older version generated, in addition to new reports

required by the changed regulations.
To ensure that the new version meets its specifications, your team will

perform testing on the package prior to full deployment. Among the

specifications is the requirement that the new version perform

identically to the older version on reports that both versions support.

You want to test the package to verity correct support for these

reports Which kind of testing should you perform?
A. unit testing
B. integration testing
C. customer acceptance testing
D. regression testing
E. beta testing



2. Your company develops a new Windows-based application for a

customer. The customer has been unwilling to send any employees to your

office during the development cycle because of the distance between

your office and the customer's office.
The application has passed its unit and integration testing phases at

your office. You are ready to install the application and begin the

user acceptance phase of testing at the customers office.
What should take place at the customer location to ensure effective

user acceptance testing?
A. user training
B.regression testing
C.integration testing
D. code inspection



3. Your company is developing a system that includes several dozen

applications that use a common database. Each of these applications is

developed independently by its own team of developers.
You are the team leader for the software test group. Your group is

working with the systems
specifications team for the software to write a plan that assures that

the software meets specifications.
Which level of testing should you plan to do first?
A. beta testing
B. unit testing
C. database integration testing
D. user acceptance testing
E. system testing



4 You are designing a database application. The application must access

data from a variety of sources, including relational databases, indexed

sequential databases, e-mail, and spreadsheets. Some of these databases

might reside on remote servers. You must choose a data access method

that can interact with all of these data formats. For efficiency, the

method must not emulate a relational database with non-relational

formats.
Which access method or methods should you use? (Choose all that apply.)
A. ODBC
B. ODBCDirect
C. OLE DB Templates
D. RDO
E. ADO
F. DAO


5. You will be presenting a lecture to a programming class. You plan to

introduce the Document/View architecture to the students. You must

create a program that is well suited to illustrating the Document/View

architecture.
Which type of program should you use?
A. a communications application
B. a device driver
C. a text editing program
D. a Microsoft Transaction Server (MTS) component
E. an ActiveX user interface control

6. You are implementing a Visual C++ application for processing

requests for monetary loans. According to the logical design, the

business rules for validating loans are subject to frequent changes.
How should you implement the business rules?
A. as triggers in a Microsoft SOL Server database
B. as a new release of the application
C. as one or more COM components
D. as one or more active documents



7. You have a project written in Visual C++. You want to convert it to

a COM component. You will do this by adding COM interface Methods to

the existing code.
Which method or methods must you add? (Choose all that apply.)
A. QueryInterface
B. CreateAccessor
C. Release
D. Initialize
E. AddRef
F. Load
G. Terminate

.
8. You are writing a Windows-based application that accesses an SQL

database through an optimized driver. Because many other processes will

be running on the same workstation when your application is being used,

you want to choose a data access technology that will minimize

execution time in your application's process.
Which data access technology should you use?
A. ADO
B. RDO
C. ODBC
D. DAO
E. ODBCDirect





9. You write a Windows-based application by using MFC. Your application

performs statistical calculations and updates a database with the

results. If your program terminates during the update, the database may

contain incorrect but apparently valid data. For this reason, you want

to intercept system requests to terminate your application and decline

to shut down while the database is being updated.
In which function should you handle the system request to terminate?
A. OnDestroy
B. OnNoDestroy
C. DestroyWindow
D. OnEndSession
E. OnQueryEndSession
F. OnFinalRelease
G. OnClose
H. ~CWnd



10. You write a Windows-based application by using Platform SDK. In

your application, you want to initiate an action whenever the user

presses the F2 key.
Which Microsoft Windows message should you respond to?
A. WM_CHAR
B. WM_HOTKEY
C. WM_SYSKEYDOWN
D. WM_KEYDOWN
E. WM_SETHOTKEY
F. WM_GETHOTKEY


11. You write a Windows-based application to maintain a contact list.

Contacts are entered by means of a dialog box that contains the

following controls:
? an edit control for entry of the person's name
? an edit control for entry of the person's telephone number
? an edit control for entry of the person's e-mail address
? a group of two radio buttons to indicate whether me person prefers

to be contacted by telephone or by e-mail
When the E-mail preferred radio button is selected, your application

should enable the e-mail edit control and disable the telephone number

edit control. Conversely, when the Telephone preferred radio button is

selected, your application should disable the e-mail edit control and

enable the telephone edit control. How should you accomplish these

goals?
A. Call the CEdit::SetModify function with an argument of FALSE to

disable an edit control.
Call the same function with an argument of TRUE to enable an edit

control.
B. Call the CWnd::EnableWindow function with an argument of FALSE to

disable an edit control.
Call the Same function with an argument of TRUE to enable an edit

control.
C. Call the CEdit::SetLimitText function with an argument of zero to

disable an edit control.
Call the same function with an argument of one to enable an edit

control.
D. Call the CEdit::SetHandle function to select the edit control that

is to receive the focus.


12. You design a Windows-based application by using MFC. Users can

enable or disable error logging by clicking the Log Errors command on

the Tools menu of your application. Error logging is indicated by a

check mark displayed next to the Log Errors command on the Tools menu.

The state of the menu item is stored in a Boolean class member variable

named m_bLogErrors.
How should you manage the menu item?
A. Write an ON_UPDATE_COMMAND_UI handler function, and add it to the

message map.
Call the CCmdUI::SetRadio function from within the handler
B. Write an ON_COMMAND handler function, and add it to the message map.
Call the CcmdUI::Enable function from within the handler.
C. Write an ON_UPDATE_COMMAND_UI handler function, and add it to the

message map.
Call the CCmdUI::Enable function from within the handler.
D. Write an ON_COMMAND handler function, and add it to the message map.
Call the CCmdUI::SetCheck function from within the handler.
E. Write an ON_UPDATE_COMMAND_UI handler function, and add it to the

message map.
Call the CCmdUI:SetCheck function from within the handler.
F. Write an ON_COMMAND handler function, and add it to the message map.
Call the CCmdUI::SetRadio function from within the handler.


13. You are coding the Most Recently Used (MRU) file section of a

Windows 98-based application. You want end users to be able see their

own MRU file lists when they run your application. You decide to store

the MRU file information in the registry by using

CWinApp::SetRegistryKey.
Which registry key should you use?
A. HKEY_CLASSES_ROOT
B. HKRY_LOCAL_MACHINE
C. HKEY_USERS
D. HKEY_CURRENT_USER


14. You are working on a Visual C++ MFC application. You want to use

the Microsoft Web Browser control. You use the Components and Controls

Gallery dialog box to insert the Web Browser control into your project.
Which two actions does Visual C++ perform for you? (Choose two.)
A. adds the control to your toolbox
B. adds die control to your dialog box
C. adds the control files to your project
D. adds the control's wrapper classes to your project
E. adds the control's interfaces to the registry

15. You are writing an in-process server object named CmyServer. You

have a client application named TestMyServer.exe that uses this object.

Calls to Cmyserver::QueryInterface return a pointer to the IUnknown

interface for all interface IDs, whether the object supports the

requested interface or not. You want to use the Visual C++ debugger to

step through the CmyServer::Queryinterface function to find the error.

To avoid introducing new behavior, you want to modify the code as

little as possible. Which three things should you do?
Multi Selection(3 answers)
A Build the server object. Specify debug options.
B Set a breakpoint on the first line of the CmyServer::QueryInterface

function.
C Load and run TestMyServer.exe in Microsoft Visual Studio.
D Build the calling application. Specify debug options.
E Add a call to the DebugBreak function in the

CmyServer::QueryInterface function
F Specify TestMyServer.exe as the Executable for debug session on the

Debug tab of the Project Settings dialog box.


16. You create an in-process COM server component that runs in the

single-threaded apartment model. You use ATL to implement this

component. Which client or clients will be able to access your

component? (Choose all that apply.)
Multi Selection (select all correct answers)
A an MFC-based client in the same process
B an SDK-based client in a different process
C an ATL-based client in the same process
D an SDK-based client in the same process
E an ATL-based client in a different process
F an MFC-based client in a different process


17. You are using Visual C++ to create a component that will provide

information to several different client applications. Some of these

applications have higher priority than others, and your component must

prioritize requests for information. How should you develop your

component?
Single Selection
A Develop your component to use HTTP to return information to client

applications. Use a persistent property in the HTTP request to set

priority. Pass information to client application in order of priority.
B Develop your component as an ActiveX user interface control. Add a

Priority property to the control Pass information to client application

in order of priority.
C Develop your component as an in-process COM server component that

accepts a reference to a notification object from each client

application. Add a Priority property to the control Use asynchronous

callbacks to pass information back to client application in order of

priority.
D Develop your component as an out-of-process COM server component

that accepts a reference to a notification object from each client

application. Add a Priority property to the control Use asynchronous

callbacks to pass information back to client application in order of

priority.


18. Your MFC-SDI application has two form views named CformView1and

CformView2. CFormView1 has a combo box control that you associate with

a CComboBox member variable. Cformview2 has an edit control that you

associate with a CString member variable. Every time the user switches

from CformView1 to CformView2, you want the edit control to display

current value of the combo box that is on CformView1. Which function

should you use for this purpose?
Single Selection
A OnActivateView
B OnInitialUpdate
C OnUpdate
D OnSetFocus


19. Your MFC-SDI Visual C++ application uses a CFormView that displays

data from a Microsoft Access table. When a record is edited or added, a

variable named m_bSaved is set to False. Once the current record has

been properly saved, m_bSaved is set to TRUE. When a user attempts to

close the application, you want to affirm as early as possible that the

current record has been saved. Which method should you use to achieve

this goal?
Single Selection
A CmainFrame::OnClose
B CformView::OnCloseDocument
C CmainFrame::OnDestroy
D CFormView::OnDestroy


Archived topic from Iceteks, old topic ID:2891, old post ID:23576

Help

Posted: Sat Dec 04, 2004 9:59 pm
by Red Squirrel
Welcome aboard.

I hope you don't want us to do the assignment for you. :lol:

But just curious are you forced to use MFC or can you use normal C++? I only know basic of both, so hopefully someone can lead you in the right direction.

Archived topic from Iceteks, old topic ID:2891, old post ID:23579