MFC

  Home  Computer Programming  MFC


“Microsoft Foundation Class (MFC) frequently Asked Questions in various MFC job Interviews by interviewer. Get preparation of Microsoft Foundation Class (MFC) job interview”



26 MFC Questions And Answers

22⟩ What is model and modeless dialog box? Give some examples?

Modal dialog is one which will not allow u to access any thing until this dialog is active.

Call:

Dialog::DoModal()

And reverse of this ur modeless dialog.

Dialog::ShowDialog();

For Example:

Modal Dialog:

When we access Menu items such as Save as, Open, attach file, in any application, we can not able to access any part of the application execpt the active dialog.

When we open add remove program for uninstalling any application, u will get a Uninstallation dialog which will be modeles. bcz still u were able to access add remove programs. (this is probably in Vista. And in XP its modal dialog which they have used)

 137 views

25⟩ What is synchronization objects types and where we are using in the code?

CRITICAL_SECTION :- CRITICAL_SECTION (CS) objects are initialized and deleted but do not have handles and are not shared by other processes. A variable should be declared to be of type CRITICAL_SECTION. Threads enter and leave a CS, and only one thread at a time can be in a specific CS. EnterCriticalSection blocks a thread if another thread is in the section. The waiting thread unblocks when another thread executes LeaveCriticalSection. If a thread already owns the CS, it can enter again without blocking; that is, CRITICAL_SECTIONs are recursive. CRITICAL_SECTIONs have the advantage of not being kernel objects and are maintained in user space. This usually, but not always, provides performance improvements.

Mutex: - mutexes can be named and have handles, they can also be used for interprocess synchronization between threads in separate processes. Mutex objects are similar to CSs, but, in addition to being process-sharable, mutexes allow time-out values and become signaled when abandoned by a terminating process.A thread gains mutex ownership (or locks the mutex) by waiting on the mutex handle (WaitForSingleObject or WaitForMultipleObjects), and it releases ownership with ReleaseMutex.

Semaphore :- Semaphores maintain a count, and the semaphore object is signaled when the count is greater than 0. The semaphore object is unsignaled when the count is 0.

Event :- Events are used to signal other threads that some event, such as a message being available, has occurred.

 141 views

26⟩ Whats is DDX & DDV in MFC?

Dialog data exchange (DDX) is an easy way to initialize the

controls in your dialog box and to gather data input by the

user. Dialog data validation (DDV) is an easy way to

validate data entry in a dialog box.

 152 views