Sie sind auf Seite 1von 10

Visual Basic

Name atleast two discriminating features of Basic language and VB programming. Much enhanced version of Basic language and IDE VB can create WINDOWS programs BASIC could create DOS programs only. VB 32 bit programming language and 16 bit (VB 3) VB provides massive support for easily created user interface to applications. What is animated cursor? Does Vb support it? Animated cursor is a special type of cursor. It consist of sequences of static cursors that are played back in rapid succession to produce a small animation. Vb does not support. What is control driven programming model. In this model the flow of execution is predetermined. The execution path is completely controlled by the program. Structured languages support control driven programming model. What is Local window? This window shows the value of any variables within the scope of the current procedure. As the execution switches from procedure to procedure the contents of the locals window change to reflect only the variables applicable to the current procedure. What is the use of preserve keyword in VB? Whenever Redim statement is executed, all the values currently stored in the array are lost.Preserve keyword is used to resize an array without losing its contents. Write short note on Light weight controls? VB has the ability to create light weight controls. These controls do not have the window handle(hWnd property). This means that they use fewer system resources, making them ideal forinternet applications, distributed applications or any application where system resources may be alimiting factor. How will you force to declare the variable compulsorily in VB? By using option explicit statement. This statement tells the compiler to check each variableand issue an error message if it is used without declaration. .What are the advantages of using Control arrays in VB? (i) Use fewer resources than individual controls (ii) Share common events (iii) Same event procedure is called for all the controls in the control array. List the three kinds of resume statement in VB? Resume, Resume Next, resume Line

What are the two ways of displaying child form of an MDI form in VB 6.0? By setting the Auto Show Children property of the MDI form module Which displays the childform as soon as the MDI Form loads.On the other hand a child form (frmchild) can be loadedmanually using the following two lines of code.Dim frm as new frmchild FRM.SHOW List the intrinsic controls which are used for graphics in VB? Picture Box Image Control Line Control Shape Control What are the limitations of using the graphics controls in VB? Cannot appear on top of other controls. Cannot receive focus at runtime. Cannot serve as containers for other controls. Write the statements to play the animation control in VB? To play the animation control : Name : Animation1 i) Animation1.open <filename> ii) Animation1.play Write any two database related Activex controls in VB? DBGrid, DBCombo, DBList,ADODC What is the use Locked property in a text box control in VB 6.0? When the locked property is set the user can be prevented from changing the contents of thetextbox. On the other hand it is possible to copy the value from the textbox. How will you reference the members in the collection in VB? For each <object variable> in <collection name> -----------------------------------next <object variable> Explain about the starting of a tool bar. Add a tool bar control and image list Set tool bards name property Change image tab of the property page dialog box of image list 1 control. Choose the property in the tool bar and set the image list property. Button tab set the style property. Set image property index Add the second button if needed. Set the key value and image property

To add item to the button menu click the drop down menu. Repeat step 9 for west, south and central region Click ok to close the property page dialog box. Now you get your own dialog box. Explain ActiveX controls. Active X controls are known as programmer built control can be used in VB application. ActiveX is a Microsoft term refer to group or components that include controls, DLL and active X documents. Steps involved in ActiveX controls: High level design to determine what you want to do. Use the other controls as building blocks. Start new VB ActiveX project and draw the interface Add code to enable Build the test project. Compile your control to OCX file. Advantage of ActiveX controls: When you add a existing control t your new control you get existing one Compile the controls a s a single unit User can easily under stand the control. Using the ActiveX control interface: Start a new ActiveX control project. Set the name and size Start the wizard by choosing the ActiveX control interface. Click next to start the work of setting the property Briefly explain MDI. MDI allows the program to work with multiple forms contained within the parent form one container form act as a parent form User can work with multiple documents.

MDI application: MDI application has one parent form that contain most of the other form in the program. Other form can be child form which are contained with the parent or standard form. Characteristics of MDI child form: Only one parent form Use those controls that support the align property Print method cannot be accessed. Parent and child window represented by the same icon Characteristics of MDI child form Displayed with in the child for that cannot be moved outside the parent form. Child window is minimized its icon is displayed in the parent window. When a child form is maximized it fills the entire inner area of the parent form One child form is maximized all other child form is maximized.

Two properties are unique for MDI Auto Show children Scroll bar How you add control array in a form Control array is a group of controls all of the same type that have the same name and are identified by a integer. Control array elements: Each in individual control in the array is referred to as an element. Must be of same type Must have same value for name Unique value for index property. Advantage: control array require limited system requirements Share a common set of event procedure Adding control while the form is running Creating control array: Add a control in the form and then copy 1 control Change the name property of the control. Set the index property to a number.

VC++
Explain the concept of windows and messaging Architectural overview Windows function class Data type Getting a handle on handles Creating the window Displaying the window Window procedure Processing the messages Any Two message ( WM_PAINT, WM_DESTROY) What are the fields in MSG structure? HWND: The handle to the window which the message is directed to MESSAGE: The message identifier. This is a number that identifies an event WPARAM: A 32-bit message parameter .The meaning and value of which depend on the particular message. LPARAM: Another 32-bit message parameter dependent on the message. TIME: The time the message was place in message queue. PT: The mouse coordinates at the time the message was placed. Write the prototype of WinMain function? WinMain Function Prototype: int WINAPI WinMain (HINSTANCE hinstance, HINSTANCE hprevinstance, PSTR szcmdline, int icmdshow) What is Windows Programming? Windows Programming uses GUI concepts. It is an event driven programming. An Application Windows will respond to the events by generating a message by the Operating System. It uses graphics for organizing user workspace. Programs that run within Windows also use GUI. (e.g.) Word, Excel. These application programs use some built in functions present in API. Difference between DOS based programming & windows based programming. DOS based programming: (a). Hardware Dependent. (b). Activated when OS is called. (c). Never calls the program running under it. Window Based Programming: 1. Hardware Dependent.

2. 3.

Activated when it receives the message Call when the program running under it.

List the main header files in Widows Programming? WINDOWS.H WINDEF.H WINNT.H WINBASE.H WINUSER.H WINGDI.H What is an API? API stands for Application Programming Interface. API is a set of commands that interfaces program with processor. It is a set of routine, protocols and tools for developing a software application. API programs are written in C language. Name any platform independent API?. Platform Independent API is portable to any OS. There are two platforms independent APIs i. WIN 16 ii WIN32 What is Hungarian Notation? The naming conventions for windows programming is called as Hungarian Notation. In-this notation the variable names are preceded with key letters. The key letters describe the type of data the variable represents. Example, h handle sz character string terminated by zero. What are the steps required to create a window? The steps required to create a window are. (a) Registering. Window Class (b) Create a Window (c) Message Loop (d) Window Procedure How to register a Windows Class? Before creating an application window the window class must be registered. Window Class is registered by calling register class. This function requires a single parameter, which is a pointer to structure of, type WINDGLASS. What is a Window Class?

A Window is always created using a Window Class. The window class identifies the window procedure that processes messages to the window. The window class defines the window procedure and some other characterizing of window that created based on the class. How to create a Window? CreateWindow(); This command allows us to specify more detailed information about the window. Syntax: CreateWindow("szWinName, "Title", WS_OVERLAPPEDWINDOW); Define Message Loop? When a windows, program begins execution, a window creates a "message queue" for the program; this message queue stores messages to all the windows a program might create A windows application includes is short check of code called the Message Loop to retrieve those messages from the queue and dispatch the to the appropriate window procedure. A simple message to enters of one function call to each of three functions, GetMessage, TranslateMessage and DispatchMessage What is the use of Translate Message? A Message Loop include Translate Message, if the message loop receive character input from the keyboard, the system generates virtual key message CW_KEYDOWN and WM_KEYUP each time the user process the key. What is use of Dispatch Message? The Dispatch Message function sends a message to the window procedure associated with the window handle specified in the MSG structure. What are the actions of windows procedure? The windows procedure is the function named wndproc. The windows procedure determines what the window displays in its client area the window responds to user input. A window procedure is defined as, LRESULT CALLBACK Wndproc(HWND hwnd, UNIT message, WPARAM wParam, LPARAM lParam) What is WM_PAINT message? Thus message informs when a part or all of the windows client area, is "invalid" and must be "updated" which means that it must be redrawn or "painted". How does WM_PAINT message is processed? WM_PAINT processing almost always begins with a call to Begin Paint and ends with a call to EndPaint HDC hdc; hdc= BeginPaint(hwnd, &Ps);

EndPaint(hdc, &Ps); BeginPaint - erases the background EndPaint - releases the device context handle. What is WM.DESTROY message? WM_DESTROY message indicates that a window is in the process of destroying a window based on a command from the user. The message is a result of the user clicking on the close button or selecting close from the programs System message. What is GDI? The Graphics User Interface (GDI) provides functions and related structures that an application can use to generate graphical output for displays, printers and other devices. What are the fields in MSG structure? HWND : The handle to the window which the message is directed to MESSAGE: The message identifier. This is a number that identified the message. WPARAM: A-32 bit message parameter dependent on the message. LPARAM: Another 32-bit message parameter dependent on the message TIME : The time message was placed in the message queue. PT: The mouse coordinates at the time message was placed. When does the window procedure receive a WM_PAINT message? (a) When a previous hidden area of the window is brought into view when a user moves a window or uncovers a window (b) (c) (d) The user resizes the window ,(if the window class style has set bits) The program user the scroll window or scroll dc function to scroll part of its client area The program uses the invalidaterect or invalidates RG function.

What are the various groups into which GDI function calls are grouped? a. b. c. d. e. Function that get and release a device context. Function that obtain information about device context. Function that draw something Function that set and attributes of the device context. Functions that work with GDI objects.

What are valid and invalid rectangles? In the client area, when a dialog box overlies on part of client area repainting is required only for the rectangle area covered by dialog box that area is called invalid rectangle. So after repainting that rectangle, it is called as valid rectangle. What arc the GDI function calls? GDI function calls can be classified in several board groups

* *. * * *

Functions that get and release a device context Functions that obtain information about the-device context Functions that draw something Functions that set and attributes of the device contents Functions that work with GDI "objects".

What are the GDI primitives? The types of graphics we display on the screen can themselves be divided several categories which are called primitives * * * * Lines and Curves Filled areas Bitmaps Text

..

What are the other staffs (aspects) of GDI? Other aspects of GDI are not so easily classifiable these are * * * * * * * Mapping nodes and transforms Metafile Regions Paths Clipping Palettes Painting

Give some messages used in windows? WM_CREATE : This message is sent when a window is being created. WM_LBUTTONDOWN: This message is sent when the user presses the left. WM_CHAR ; This message is sent when the user types a character. WM_CLOSE : This message is sent when the user closes a window. WM_COMMAND : This message is sent to appropriate window in response to user menu choices, dialog button clicks and so on. Mention some window resources? Accelerator. Dialog. Icon. Menu. String table Tool Bar. Version.

Explain WM_NOTIFY message? The original window controls sent their notifications in W_COMAND messages. The standard 32-bit wparam and lparam message parameters are not sufficient. Microsoft solved this "bandwidth" problem by defining a new message, WM_NOTJFY. With the WM_NOTIFY message wparam is the control ID and lparam is a pointer to an NMHDR structure. Define Appwizard Appwizard is a code generator used to create a working skeleton for the windows with features source code and features specified through dialog boxes. What are GDI objects? A window GDI object type is represented by an MFC library class. CGdiObject is the abstract base class for the GDI object classes. A C++ object of a class derived from CGdiObject represents a windows GDI object. Mention some of the GDI derived classes? CBitmap CBrush CFont CPalette CPen CRgn Difference between modal and modeless dialogs? The CDialog- base class supports both modal and modeless dialogs. With a modal dialog, such as open file dialog, the user cannot work elsewhere in the same application until the dialog is closed. With the modeless dialog, the user can work in another window in the application while the dialog remains on the screen, eg: Find and replace dialog. What is system modal dialog? The 16-bit version of windows support a special kind of modal dialog called a system modal dialog, which prevents the user from switching to another application. Win32 also supports system medal dialogs but with weird results: the user can switch to another application, but the dialog remains as the top window.

What is an application framework? Application frame work is an integrated collection of object-oriented software components that offers all that is needed for generic application. .

Das könnte Ihnen auch gefallen