My Profile
Active Members
TodayLast 7 Days
more...
Awards & Gifts
Online Exams
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian
cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
|
CS1253-Visual Programming(Two marks)
Posted Date: 19 Mar 2008 Resource Type: Articles/Knowledge Sharing Category: General
|
Posted By: Logeshwaran Member Level: Gold Rating: Points: 5
|
|
|
|
Visual Programming - Set 3
1. What are the two types of dialog boxes?
Dialog boxes are classifies into
Modal dialog boxes
Modeless dialog boxes
2. What are modal dialog boxes?
Modal dialog boxes require the user to respond before the application continues. These modal boxes can be stacked so that one dialog boxes starts another, thus forcing control to the most recent dialog box and returning to the calling dialog box when closed.
3. What are Modeless dialog boxes?
Modeless dialog boxes behave much more like normal windows, allowing the user to do the work with in the application.
Example: A user might open a modeless dialog boxes and carry out some actions then convenience, rather than closing it, the user might just move it out of the way and continue working with application.
4. Define Serialization?
Serialization is the process of writing or reading an object to or form a persistent storage medium, such as disk file.
5. What is an accelerator key?
A keystroke or a combination of keystrokes that invokes a particular command is called an accelerator key.
6. Define ActiveX Control?
Active X control is the new name for programmable elements formerly known variously as OLE controls, OCXs or OLE custom controls. Controls previously built with the MFC control developer’s kit meet the ActiveXcontrol specification.
7. Define deserialization?
Recreating an object by reading its state from persistent storage and reconstructing it is memory is called deserialization.
8. What is a toolbar?
A toolbar is a child window with buttons and other types of controls such as combo boxes. These controls allow the user to issue commands with a simple mouse click.
9.What is a status bar?
A status bar is child window positioned at the bottom to the main window. It is used to display context sensitive help messages fro menu items and toolbar buttons. It also displays text messages such as ‘NUM’ to tell the user that NUM lock is on.
10.What are the four main components to the MFC document/view architecture?
The four main components to the MFC document/view architecture are,
Documents
Views
Documents/view frames
Document templates
11.What is a document object?
The document object conceptually holds the data used by the application; it is responsible for storing, loading and saving the associated with the application.
12.What is a splitter window?
A splitter window is a basic window that can be divided vertically horizontally or both vertically and horizontally into two or more panes by movable splitter base.
13.What are the two types of splitter windows?
The two types of splitter windows are static and dynamic splitter windows.
14.What are dynamic splitter windows?
Dynamic splitter window is the easiest of two types of splitter windows, to create and initialize. IN dynamic splitter windows, additional panes are created and destroyed as the user splits and unsplits the views.
15.What are the static splitter windows?
A static splitter window requires a little more work than dynamic splitter windows. In static splitter windows, the panes are created when the window is created, and the order and number of panes never change. The panes are separated by the splitter bar that can change the relative sizes of panes.
16 .What is COM?
It stands for Component Object Model .It provides unified expandable object oriented communication protocol for windows that allows to mix all sorts of disparate software ports together at run time regardless of thread awareness and language choice.
17. What are DLLS?
Dynamic link libraries are complied library which contain codedatas and resources that can be attached to application at run time.
These libraries are implemented separate files with default extension DLL and can be shared by several applications.
18.What is the difference between ActiveX control and ordinary window control?
ActiveX control does not send WM notification message instead of it “Fire Events”.
Visual Programming - Set 2
Define Resource script file. The Resource Script file contains the resources such as Bitmaps, Icons, Images which is being used by an application. This file is given as input to the Resource Compiler. It is being generated for every application to contain the resources used by that application.
What is the use of ‘OnDraw’ function? ‘OnDraw’ is a virtual member function of the CView class that the application framework calls everytime the view window needs to be repainted.
For eample, whenever a window is resized or when a hidden area is revealed, the ‘OnDraw’ function is invoked.
What is meant by Event handling? Most of the Windows based applications depend on member functions which are activated in response to an ‘Event’ like keystroke, mouse right button click etc. These functions effectively handle the events and are called by the Application framework, whenever necessary.
What is the difference between SDI and MDI? SDI (Single Document Interface): An SDI application contains only one window (i.e.) at a time, only one document can be loaded.
MDI (Multiple Document Interface): An MDI contains multiple child windows, each of which contains corresponds to an individual document.
What are the advantages of developing applications using Application Framework? Use of Standard structure Applications are smaller in size and fast Reduction in coding time
What is the purpose of ‘OnLButtonDown’ function? This function is activated whenever the left-side button of the mouse is pressed down. By clicking the left button down, the code written for the function ‘OnLButtonDown’ gets executed. The function requires two parameters to know the status of the button and the position of the pointer.
Define Message Mapping. The MFC library Application framework uses macros to map specified messages to derived class member functions.
The message map system avoids large number of tables (containing maintenance data) and accommodates application specific command messages along with ordinary Windows messages.
8. What is the purpose of Linker in a VC++ application build process?
The Linker combines the Resource file (generated by the Resource Compiler) and the Code compiler output to produce an Executable file.
Visual Programming - Set 1
1. What are the advantages of Windows Environment?
(i) User friendliness – Makes easier for an end-user to understand the operations of an application
(ii) GUI - Graphical User Interface – Helps to create an application with Window, Menu, Icons, Dialog boxes, Variety of controls etc. which reduces the complexity of application development and increases user friendliness
(iii) GDI - Graphical Device Interface – Creates easy interfacing and interaction with hardware devices
(iv) Multitasking – It is a process by which more than one application can be run simultaneously
2. What is Multitasking and what are its types?
Multitasking is process by which more than one application can be run simultaneously.
The two types of multitasking are Preemptive and nonpreemptive. In non preemptive the programs themselves had to voluntarily give up control so that others programs could run.
3. List the Windows programming options.
Windows based applications can be developed in several ways.
C programs with Windows API
Visual Basic
Microsoft Visual C++
Microsoft Visual J++
4. What is the difference between DBCS and Unicode?
DBCS-Double Byte Character Set. In this set, not all the characters are represented by 2 bytes. Some characters are represented by 1 byte. Certain complex ideograph symbols need two bytes to define a single character.
UNICODE-It is also called as Wide Character sets. In this set, all the characters are represented by 2 bytes that is two bytes are needed to define a single character.
5. What is the use of Register class?
Before an application is created, the window class is registered by calling the register class. The function requires a single parameter which is a pointer to a structure of type WndClass.
RegisterClass(&WndClass)
6. What is the use of WM_PAINT message.
WM_PAINT message informs the window procedure that the client area must be repainted.
A window procedure receives a WM_PAINT message where one of the following event occurs.
(i) the user resizes the window
(ii) the program uses the scroll window or scrollDC from the scroll of its client area
(iii) the program uses the IndicateRect or InvalidateRect function to explicitly generate a WM_Paint message
7. What is the syntax of create window function call?
Create window function is used to crate the window
Syntax
Cratewindow(szAppname,
TEXT(“the hello program”),WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,NULL,hInstance,NULL);
8. Explain the parameters of createwindow?
The createwindow having the following parameters.These parameters are
szAppname-Window class name
TEXT(“the hello program”)-Window caption
WS_OVERLAPPEDWINDOW-window style
CW_USEDEFAULT-intial X position
CW_USEDEFAULT- intial Y position
CW_USEDEFAULT- intial x size
CW_USEDEFAULT- intial ysize
NULL –parant window handle
NULL –window menu handle
hInstance –program instance handle
NULL –creation parameters
9. List out some of Window function calls.
LoadIcon-Loads an icon for use by a program
Register class-Registers a window class for theb programs window.
MessageBox-Displays a message box
ShowWindow-shows the window to paint itself.
DrawText-Displays a text string
10. What do you mean by Message loop?
A Program retrieves the messages from the message queue by executing a block of code known as the “Message Loop”.
While(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
11. What are the ways to get the Device Handle?
Method1:
hdc=BeginPaint(hwnd,&ps);
hwnd=Handle to the window which is passed to the window procedure as an argument
ps=Address of a structure variable of type PAINTSTRUCT which is defined in the WINUSER.H header file
Method2:
To get a handle to the device context of the client area of the window,you call the GetDC
To obtain the handle and Release DC after you are done with it.
Hdc=GetDC(hwnd);
[use GDI functions ]
ReleaseDC(hwnd,hdc);
12. What are the functions used to display the string in window?
1.DrawText-display the string in window with specified x,y coordinates.
2.TextOut- display the string in window with specified x,y coordinates.
13. What do you mean by InvalidateRect function and syntax?
The InvalidateRgn function invalidates the client area within the specified region by adding it to the current update region of a window. The invalidated region, along with all other areas in the update region, is marked for painting when the next WM_PAINT message occurs.
BOOL InvalidateRgn(
HWND hWnd, // handle of window with changed update region
HRGN hRgn, // handle of region to add
BOOL bErase // erase-background flag
);
Parameters
hWnd
Handle to the window with an update region that is to be modified.
hRgn
Handle to the region to be added to the update region. The region is assumed to have client coordinates. If this parameter is NULL, the entire client area is added to the update region.
bErase
Specifies whether the background within the update region should be erased when the update region is processed. If this parameter is TRUE, the background is erased when the BeginPaint function is called. If the parameter is FALSE, the background remains unchanged.
Return Values
The return value is always nonzero.
14. What is the structure of WNDCLASS?
The WNDCLASS structure contains the window class attributes that are registered by the RegisterClass function.
typedef struct _WNDCLASS {
UINT style; WNDPROC lpfnWndProc; int cbClsExtra; int cbWndExtra; HANDLE hInstance; HICON hIcon; HCURSOR hCursor; HBRUSH hbrBackground; LPCTSTR lpszMenuName; LPCTSTR lpszClassName; } WNDCLASS; 15. What is the syntax of WINMAIN function?The WinMain function is called by the system as the initial entry point for a Win32-based application.
int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // pointer to command line int nCmdShow // show state of window);
|
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|
|
Watch TV Channels
|