Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What Is Win32?

Answer»

WIN32 refers to Microsoft 32 bit WINDOWS API. Win32 Applications are PROGRAMS which are built with the Win32 API.

Win32 refers to Microsoft 32 bit Windows API. Win32 Applications are programs which are built with the Win32 API.

2.

What Is Function Entry For Dll In Win3.1?

Answer»

Should be LibMain in win3.1

Should be LibMain in win3.1

3.

What Is System Call Executable Binary File Into A Process?

Answer»

But WinExec() is COMPATIBLE with 16-bit WINDOWS.

APPLICATIONS should USE the CreateProcess function.http://msdn.microsoft.com/en-us/library/ms687393(VS.85).ASPX

But WinExec() is compatible with 16-bit Windows.

Applications should use the CreateProcess function.http://msdn.microsoft.com/en-us/library/ms687393(VS.85).aspx

4.

Win 3.1 Supports Which Type Of Multi Tasking?

Answer»

Win3.1 supports co-operative multi-tasking. Once a PROCESS is given the control for execution, the other tasks have to wait until the current has relinquished its execution.

WinNT is PREEMPTIVE multi-tasking. A process can be stopped in the middle if another process needs CPU cycle. This is HANDLED by the windows OS.

Win3.1 supports co-operative multi-tasking. Once a process is given the control for execution, the other tasks have to wait until the current has relinquished its execution.

WinNT is preemptive multi-tasking. A process can be stopped in the middle if another process needs CPU cycle. This is handled by the windows OS.

5.

What Are The Com Components?

Answer»

It evolved like this when u write a CLASS to reuse in a application, multiple INTANCES of the class EXISTS with each instance of application, Next u want to avoid it so u make a class and PUT it in DLL now only one instance exists though multiple instances of applications exists Applicatoin needs to be recompiled whenever Dll is modified, SO came COM. COM is independent component that internally handles networking, resources ETC, COM USES IDL to communicate to different languages.

It evolved like this when u write a CLASS to reuse in a application, multiple intances of the class exists with each instance of application, Next u want to avoid it so u make a class and put it in DLL now only one instance exists though multiple instances of applications exists Applicatoin needs to be recompiled whenever Dll is modified, SO came COM. COM is independent component that internally handles networking, resources etc, COM uses IDL to communicate to different languages.

6.

How To Initialize Contents Of A Dialog?

Answer»

In MFC, the contents of a DIALOG are INITIALIZED if they are ASSOCIATED with their CORRESPONDING data members. This is done through "UpdateData(FALSE)" function. The control data is transferred to the data members through "UpdateData(TRUE)".

In WIN32, the dialog data in controls can be initialized during WM_INITDIALOG CALL. The control data can be updated to the dialog members using apppropriate "SendMessage" functions.

In MFC, the contents of a dialog are initialized if they are associated with their corresponding data members. This is done through "UpdateData(FALSE)" function. The control data is transferred to the data members through "UpdateData(TRUE)".

In WIN32, the dialog data in controls can be initialized during WM_INITDIALOG call. The control data can be updated to the dialog members using apppropriate "SendMessage" functions.

7.

What Is The Difference Between Mfc And Win32?

Answer»

WIN32 is a SET of Windows APIS written in C and MFC is a framework built arround Win32. All MFC FUNCTIONS INTERNALLY use Win32 APIs. And MFC is written in C++.

Win32 is a set of Windows APIs written in C and MFC is a framework built arround Win32. All MFC functions internally use Win32 APIs. And MFC is written in C++.

8.

What Are The Design Patterns Of An Mfc Application?

Answer»

It uses main three patterns,

Singleton PATTERN - Application object(CWinApp & its derived CLASSES)

Bridge pattern - Serialization

Observer patten - Document/View Architecture

If we DIG deeper into the MFC classes, it may use some other patterns ALSO.

It uses main three patterns,

Singleton pattern - Application object(CWinApp & its derived classes)

Bridge pattern - Serialization

Observer patten - Document/View Architecture

If we dig deeper into the MFC classes, it may use some other patterns also.

9.

In Win32 Application Can We Use Cstring Datatype?

Answer»

A faik CSTRING is a MFC class. You cannot USE it in win32 APPLICATION unless you set your application to use MFC LIBRARIES. To use MFC in win32 application, go to project settings and in general tab, set it to use MFC libraries in shared DLL. Then you can include MFC FRAMEWORK files like afxwin.h.

A faik CString is a MFC class. You cannot use it in win32 application unless you set your application to use MFC libraries. To use MFC in win32 application, go to project settings and in general tab, set it to use MFC libraries in shared DLL. Then you can include MFC framework files like afxwin.h.

10.

What Api Used To Hide Window?

Answer»
  • ShowWindow(HWND, SW_HIDE); // to HIDE WINDOW
  • ShowWindow(hwnd, SW_SHOW); // to SHOW window

11.

How To Load Bitmap In Dialog Background In An Mfc Application?

Answer»

In OnInitDialog:

-----------------

1. Create CBitmap from the bitmap.

2. Create a memory DC (CDC)

3. PUT the CBitmap into the memory DC (Use CDC::SelectObject function).

In OnPaint:

------------

4. GET your dialog DC (CDialog::GetDC)

5. Do BitBlt or StretchBlt on dialog DC with memory DC as source DC (this will paint the bitmap on your dialog).

6. RELEASE dialog DC (RELEASEDC function)

In OnInitDialog:

-----------------

1. Create CBitmap from the bitmap.

2. Create a memory DC (CDC)

3. Put the CBitmap into the memory DC (Use CDC::SelectObject function).

In OnPaint:

------------

4. Get your dialog DC (CDialog::GetDC)

5. Do BitBlt or StretchBlt on dialog DC with memory DC as source DC (this will paint the bitmap on your dialog).

6. Release dialog DC (ReleaseDC function)

12.

In Win32 Application If Defining A Variable Of Cstring Then It Gives The Error "cstring:undeclared Identifier" How To Solve The Problem? What Headerfile Need To Include?

Answer»

A faik CString is a MFC class. You cannot use it in win32 application unless you set your application to use MFC LIBRARIES. To use MFC in win32 application, go to PROJECT settings and in GENERAL TAB, set it to use MFC libraries in SHARED DLL. Then you can include MFC framework files like afxwin.h.

A faik CString is a MFC class. You cannot use it in win32 application unless you set your application to use MFC libraries. To use MFC in win32 application, go to project settings and in general tab, set it to use MFC libraries in shared DLL. Then you can include MFC framework files like afxwin.h.

13.

Java Is Pure Object Oriented Programming Language Why?

Answer»

Java just uses object ORIENTED PRINCIPALS but it is not purely object oriented , because int is a primitive data type in Java but not an object SIMILARLY all primitive data types a pure object oriented language should not support a non object oriented ASPECTS.

Java just uses object oriented principals but it is not purely object oriented , because int is a primitive data type in Java but not an object similarly all primitive data types a pure object oriented language should not support a non object oriented aspects.

14.

What Is Use Of The Createwindow Object?

Answer»

createWindow() PHYSICALLY creates the WINDOW in memory BASED on the previousy registered WNDCLASS structure and returns a vaild HANDLE for that Window.

createWindow() physically creates the Window in memory based on the previousy registered WNDCLASS structure and returns a vaild HANDLE for that Window.

15.

What Is Preemption And Context Switching?

Answer»

Pre EMPTION is releasing the process in order to SERVE ANOTHER process to utilize the same RESOURCE. Context switching is the TRANSFER of resource from once process to another process.

Pre emption is releasing the process in order to serve another process to utilize the same resource. Context switching is the transfer of resource from once process to another process.

16.

What Message Displayed When A Window Is Destroyed?

Answer»

WM_QUIT message in the program message queue is POSTED. This causes WINMAIN to drop out of message loop and EXIT the runing APPLICATION.

WM_QUIT message in the program message queue is posted. This causes WinMain to drop out of message loop and exit the runing application.

17.

Write About Send Message And Post Message?

Answer»

SendMessage is a blocking call. ie., when a SendMessage() API is called from an application, the lines WRITTEN after this API call cannot be EXECUTED until the message is processed and returned by the window procedure.

Whereas PostMessage() just posts the message into the windows corresponding message queue and returns IMMEDIATELY IRRESPECTIVE of the message is processed or not.

SendMessage is a blocking call. ie., when a SendMessage() API is called from an application, the lines written after this API call cannot be executed until the message is processed and returned by the window procedure.

Whereas PostMessage() just posts the message into the windows corresponding message queue and returns immediately irrespective of the message is processed or not.

18.

What Is The Function To Repaint A Window Immediately?

Answer»
  1. INVALIDATE():To repaint the ENTIRE CLIENT AREA
  2. InvalidateRect():To repaint a SPECIFIC portion of the client area.

19.

Message To Limit The Size Of Window?

Answer»

BOOL MoveWindow(

HWND hWnd, // handle to window

int X, // horizontal POSITION

int Y, // vertical position

int nWidth, // width

int nHeight, // height

BOOL bRepaint // repaint OPTION

);

This cud be used in the WM_PAINT event section and in WM_INITDIALOG section. WM_SIZE MESSAGE is received by the window procedure when a user RESIZES a window. In order to limite the size of a window, you could handle the WM_SIZE message appropriately.

BOOL MoveWindow(

HWND hWnd, // handle to window

int X, // horizontal position

int Y, // vertical position

int nWidth, // width

int nHeight, // height

BOOL bRepaint // repaint option

);

This cud be used in the WM_PAINT event section and in WM_INITDIALOG section. WM_SIZE message is received by the window procedure when a user resizes a window. In order to limite the size of a window, you could handle the WM_SIZE message appropriately.

20.

What Is Gdi Object?

Answer»

GDI object (is a graphical device object) used to write on a device CONTEXT for graphical output.

GDI objects are: PEN, Brush, Font,Line, RECTANGLE etc.

  • These objects are created using their corresponding win32 function. For eg, CreatePen, reatePenIndirect are used to CREATE a pen object.
  • After these objects are created they would need to be SELECTED to the device context before processing using "SelectObject" function. 
  • GDI objects are not associated with any device context during its creation. SelectObject function does that assocaition.
  • Once an object is selected into the device context it would be available until the object is destroyed through DeleteObject or the program exits.

GDI object (is a graphical device object) used to write on a device context for graphical output.

GDI objects are: Pen, Brush, Font,Line, Rectangle etc.