final term examination -...

51
www.vustudents.ning.com FINAL TERM EXAMINATION SPRING 2011 (18 JULY 2011) BY IMRANGEE CS410 – WINDOWS PROGRAMMING Time: 120 min Marks: 80 Total 53 Questions 40 x MCQs 5 x 2 Marks Questions 5 x 3 Marks Questions 3 x 5 Marks Questions Subjective Portion is as under:- Question No: 41 ( Marks: 2 ) What is the purpose of Bind Function? Question No: 42 ( Marks: 2 ) What is the purpose of List View Control? Question No: 43 ( Marks: 2 ) What is a custom resource? Question No: 44 ( Marks: 2 ) Write following statement in words Const char *ptr=buff Question No: 45 ( Marks: 2 ) Differentiate between Simple Windows Programs & Dynamic Link Library program? www.vustudents.ning.com

Upload: vodat

Post on 18-May-2019

215 views

Category:

Documents


0 download

TRANSCRIPT

www.vustudents.ning.com

FINAL TERM EXAMINATIONSPRING 2011 (18 JULY 2011) BY IMRANGEE

CS410 – WINDOWS PROGRAMMING

Time: 120 min Marks: 80

Total 53 Questions40 x MCQs5 x 2 Marks Questions5 x 3 Marks Questions3 x 5 Marks Questions

Subjective Portion is as under:-

Question No: 41 ( Marks: 2 )

What is the purpose of Bind Function?

Question No: 42 ( Marks: 2 )

What is the purpose of List View Control?

Question No: 43 ( Marks: 2 )

What is a custom resource?

Question No: 44 ( Marks: 2 )

Write following statement in words

Const char *ptr=buff

Question No: 45 ( Marks: 2 )

Differentiate between Simple Windows Programs & Dynamic Link Library program?

Question No: 46 ( Marks: 3 )

what are the three conditions of  sending WM_Paint Message?

Question No: 47 ( Marks: 3 )

Define the names of resource-definition statements’ categories?

Question No: 48 ( Marks: 3 )

Write down any three parameter of send function?

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 49 ( Marks: 3 )

If a network Engineer wants to send a packet to group of nodes then which IP address

class will be used?

Question No: 50 ( Marks: 3 )

Write down message sequence of Shift +S to windows procedure?

Question No: 51 ( Marks: 5 )

What is the equivalence in pointers and arrays in C?

Question No: 52 ( Marks: 5 )

Briefly explain Checkbox?

Question No: 53 ( Marks: 5 )

Write down the basic socket operation.

Windows Programming CS410

Total 52 questions

Total 80 marks

Total time 120 minutes

40 MCQs from all lectures but last 10 lectures were most important.

1. Socket operations (5 marks)

2. Code to handle Shift + S (5 marks)

3. Use of Translate message and Dispatch message. (5 marks)

4. Responsibilities of Kernel. (5 marks)

5. How to send message? example. (3 marks)

6. Disadvantages of threads. (3 marks)

7. Difference between simple window program and DLL. (3 marks)

8. What is CGI? (3 marks)

9. What will be the output of the given code. (2 marks)

10. What is handle to menu? (2 marks)

11. Which function is used to create window class? (2 marks)

www.vustudents.ning.com

www.vustudents.ning.com

12. There was question regarding semaphore. (2 marks)

CS410Current papers Spring2010

1.1. Briefly explain Message Box.

2. What are the uses of Dialogues.

3. Thread Synchronization?

4. What is MIME?

5. What is HTTP?

6. Any two advantages of threads?

7. Difference between a program and dynamic link library?

2.1. 1 question is about to write a program with DLL export function which prints a

message "Hello, DLL exported...(5 marks)2. 1 is about a mouse center button, and how we check is there any mouse

attached to system....(5 marks)

3. What is Virtual Directory? and explain...(5 marks);

4. 3 steps of resource file....(3 marks)

5. What is HTTP? (2 marks)

6. What is a message?(3 marks)

7. What is ***** box(3 marks)

8. What is list box (2 marks)

3.1. What is a process 2marks

2. What is a window menu briefly explain?2marks

www.vustudents.ning.com

www.vustudents.ning.com

3. What is a bind?2marks

4. Difference between simple program and dynamic linking library 3marks

5. Difference between shout cut menu and window menu 5marks

6. Briefly explain DNS?5marks

7. One question based on scenario 5marks

8. What is dialogue box menu 3marks

FINALTERM EXAMINATION Fall 2008

CS410- Visual Programming (Session - 1) Ref No: 318702 Time: 120 min

Marks: 75Student Info StudentID:

Center: OPKST

ExamDate: 2/4/2009 12:00:00 AM

Question No: 1 ( Marks: 1 ) - Please choose one

Consider the following statements written in a DLL: __declspec (dllexport) int Factorial(int);int Average(int, int);

Which of the following statements is true about the above statements? ► Factorial() and Average() are 2 public functions of the DLL ► Average() is the only public functions of the DLL ► Factorial()is the only public functions of the DLL ► This DLL does not have any public functions Question No: 2 ( Marks: 1 ) - Please choose one

Which one of the following operations is common to both client and server sockets:

www.vustudents.ning.com

www.vustudents.ning.com

► Bind ► Listen ► Accept ► Send Question No: 3 ( Marks: 1 ) - Please choose one

What will happen if we use PostThreadMessage for a thread that does not have the message queue?

► Nothing will happen ► It will cause a run time error ► Thread will resume processing ► Its message queue will be created Question No: 4 ( Marks: 1 ) - Please choose one

To create semaphore objects which function use by thread?

► CreateSemaphore() ► CreateSemaobject() ► CreateObject() ► Create() Question No: 5 ( Marks: 1 ) - Please choose one

RFC stands for

► Request for comments

► Request of connects

► Reference for connect

► Request for cancels

Question No: 6 ( Marks: 1 ) - Please choose one

www.vustudents.ning.com

www.vustudents.ning.com

When every any GDI function call is made or send message or post message function calls are made then which queuing will create?

► Message Queuing

► Function Queuing

► Process Queuing

► None of the given

Question No: 7 ( Marks: 1 ) - Please choose one

Copy-on-write protection is an optimization that allows multiple processes to map theirvirtual address spaces such that they share a physical page until one of the processesmodifies the page. This definition belongs to which technique.

► Lazy evaluation

► Fast evaluation

► Process evaluation

► None of the given

Question No: 8 ( Marks: 1 ) - Please choose one

If the dialog box procedure returns FALSE, then which message handling will be performed?

► Default

► Instance

► Object

► None of the given

Question No: 9 ( Marks: 1 ) - Please choose one

How many parameters take the dialog box procedure?

www.vustudents.ning.com

www.vustudents.ning.com

► 1 ► 0 ► 6 ► 4 Question No: 10 ( Marks: 1 ) - Please choose one

What does hmenu mean?

► Handle to window

► Handle to the menu

► Handle to child window

► Handle to highest menu

Question No: 11 ( Marks: 1 ) - Please choose one

When the system sends the item's identifier to the owner window?

► When the user chooses a command item from a menu

► When the system chooses a command item from a menu

► When the user click on any window area

► When the system de-select the item menu

Question No: 12 ( Marks: 1 ) - Please choose one

If the load menu function fails so what will be the return value.

► 0

► False

► Null

► 1

Question No: 13 ( Marks: 1 ) - Please choose one

www.vustudents.ning.com

www.vustudents.ning.com

Who generate a unique handle for each menu?

► System

► User

► Dialog box

► Menu Items

Question No: 14 ( Marks: 1 ) - Please choose one

Which message function determined where to send message.

None of the given

► DispatchMessage ► MessageDispatch ► GetMessage ► None of the given

Question No: 15 ( Marks: 1 ) - Please choose one

In 32-bit windows programming, we are freed from the curse of 64k segments.

► True ► False Question No: 16 ( Marks: 1 ) - Please choose one

Which function we use to register windows classes in window?

► RegisterClass(); ► RegistersClass(); ► RegisterWin(); ► WinReg(); Question No: 17 ( Marks: 1 ) - Please choose one

Which operator manipulates individual bits?

www.vustudents.ning.com

www.vustudents.ning.com

► Individual Bits

► Linked Bits

► Individual Bytes

► Linked Bytes

Question No: 18 ( Marks: 1 ) - Please choose one

Union Person{char name[30]; //30 bytesint age;float height;};How many bytes will skip after executing ptr = ptr +1.Union Person abc, *ptr;Ptr = &abc;ptr = ptr +1;

► 30 bytes will skip after executing ptr = ptr +1. ► 31 bytes will skip after executing ptr = ptr +1. ► 32 bytes will skip after executing ptr = ptr +1. ► 38 bytes will skip after executing ptr = ptr +1. Question No: 19 ( Marks: 1 ) - Please choose one

double *ptr is pointer variable which stores double type address.

► True ► False Question No: 20 ( Marks: 1 ) - Please choose one

____________ is/are type(s) of macro.

www.vustudents.ning.com

www.vustudents.ning.com

► Object-like macro ► Function-like macro ► All of the given ► None of the given Question No: 21 ( Marks: 1 ) - Please choose one

Which of the following is not true about HTTP? ► It is a protocol ► It is stateless ► It is more difficult to implement than state-aware protocols ► A web browser is HTTP client Question No: 22 ( Marks: 1 ) - Please choose one

For TCP/IP, if the port is specified as zero, the service provider assigns a unique port to the application with a value between ________________. ► 1 and 1024 ► 1 and 4000 ► 1024 and 5000 ► 1024 and 10240 Question No: 23 ( Marks: 1 ) - Please choose one

All bits in high word of a 32-bit pointer are ____________. ► Non-zero ► Zero ► Two ► None of the given Question No: 24 ( Marks: 1 ) - Please choose one

An accelerator _____________ to correspond to a menu command. ► Needs ► Needs not ► Is essential ► Is necessary Question No: 25 ( Marks: 1 ) - Please choose one

CGI stands for: ► Control Graphics Interface ► Common Graphics Interface ► Control Gateway Interface ► Common Gateway Interface

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 26 ( Marks: 1 ) - Please choose one

Which one of the following operations is common to both client and server sockets: ► Send ► Connect ► Accept ► Bind Question No: 27 ( Marks: 1 ) - Please choose one

DLU is: ► Handle of a dialog ► Handle of a modal dialog only ► Measure of distance within a dialog box ► Name of a dialog Question No: 28 ( Marks: 1 ) - Please choose one

Neither the user nor the application can make the owner window active until the _______ is destroyed. ► Modeless dialog box ► Modal dialog box ► Child control ► All of the given Question No: 29 ( Marks: 1 ) - Please choose one

When a menu item is clicked, __________ message is sent. ► WM_MENUITEMCLICKED ► WM_MENUCLICKED ► WM_COMMAND ► WM_PAINT Question No: 30 ( Marks: 1 ) - Please choose one

How many WM_CHAR messages will be generated when Shift+A key combination is pressed from keyboard and we haven’t called TranslateMessage() before calling DispatchMessage() function? ► 0 ► 1 ► 2 ► 3 Question No: 31 ( Marks: 2 )

What is a process?

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 32 ( Marks: 2 )

What is HTTP? Question No: 33 ( Marks: 2 )

Briefly define Modal Loop? Question No: 34 ( Marks: 3 )

Define briefly Group Box? Question No: 35 ( Marks: 3 )

Which are the three parts of name when using internet address family? Question No: 36 ( Marks: 3 )

Define the names of resource-definition statements’ categories? Question No: 37 ( Marks: 5 )

State three differences between a Window Procedure and a Dialog Procedure? Question No: 38 ( Marks: 5 )

Define the purpose of connect function with syntax. What does it return?

Question No: 39 ( Marks: 10 )

Define Dynamic Link Libraries in detail? Also explain its relation with memory management? Question No: 40 ( Marks: 10 )

Show the flow of server and client socket calls using block diagram?

Solved First Quiz CS410Fall 2010

Question # 1 of 10 ( Start time: 12:25:31 Total Marks: 1

www.vustudents.ning.com

www.vustudents.ning.com

PM ) A window receives this message when the user chooses a command from the window menu Select correct option:

Answer: WM_SYSCOMMAND 

Question # 2 of 10 ( Start time: 12:26:15 PM ) Total Marks: 1 All threads share the

Select correct option:

Answer: All of the given options 

www.vustudents.ning.com

www.vustudents.ning.com

Question # 3 of 10 ( Start time: 12:26:34 PM ) Total Marks: 1 A _________ is commonly used to handle background tasks Select correct option:

Answer: Worker Thread

 

Question # 4 of 10 ( Start time: 12:27:24 PM ) Total Marks: 1 What will be the entry point to a Windows program? Select correct option:

www.vustudents.ning.com

www.vustudents.ning.com

Answer: WinMain Not Sure

 

Question # 5 of 10 ( Start time: 12:28:20 PM ) Total Marks: 1 On which machines the scheduler can move individual threads to different processors to “balance” the CPU load.

Select correct option:

Answer: Multiprocessor 

Question # 6 of 10 ( Start time: 12:29:08 PM ) Total Marks: 1 _______ is one of user interface elements Select correct option:

www.vustudents.ning.com

www.vustudents.ning.com

Answer: None of given options Not sure

 

Question # 7 of 10 ( Start time: 12:30:37 PM ) Total Marks: 1 __________ handles user inputs and responds to user events independently. Select correct option:

Answer: User-Interface Thread 

Question # 8 of 10 ( Start time: 12:31:32 PM ) Total Marks: 1 If a window owns child Windows, and we destroy owner Window then _____________. Select correct option:

www.vustudents.ning.com

www.vustudents.ning.com

Answer: Both owner and owned Windows will be destroyed

 

Question # 9 of 10 ( Start time: 12:31:55 PM ) Total Marks: 1 A process consists of __________ Select correct option:

Answer: all of given options 

www.vustudents.ning.com

www.vustudents.ning.com

Question # 10 of 10 ( Start time: 12:32:08 PM ) Total Marks: 1 ________ determines that, which threads should run and when they should run? Select correct option:

Answer: Scheduler 

FINALTERM EXAMINATION Fall 2008

CS410- Visual Programming (Session - 1) Ref No: 318702 Time: 120 min

Marks: 75Student Info StudentID:

Center: OPKST

ExamDate: 2/4/2009 12:00:00 AM

For Teacher's Use Only Q No. 1 2 3 4 5 6 7 8 Total

Marks

Q No. 9 10 11 12 13 14 15 16

Marks

www.vustudents.ning.com

www.vustudents.ning.com

Q No. 17 18 19 20 21 22 23 24

Marks

Q No. 25 26 27 28 29 30 31 32

Marks

Q No. 33 34 35 36 37 38 39 40

Marks

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 1 ( Marks: 1 ) - Please choose one

Consider the following statements written in a DLL: __declspec (dllexport) int Factorial(int);int Average(int, int);

Which of the following statements is true about the above statements? ► Factorial() and Average() are 2 public functions of the DLL ► Average() is the only public functions of the DLL ► Factorial()is the only public functions of the DLL ► This DLL does not have any public functions Question No: 2 ( Marks: 1 ) - Please choose one

Which one of the following operations is common to both client and server sockets:

► Bind ► Listen ► Accept ► Send Question No: 3 ( Marks: 1 ) - Please choose one

What will happen if we use PostThreadMessage for a thread that does not have the message queue?

► Nothing will happen ► It will cause a run time error ► Thread will resume processing ► Its message queue will be created Question No: 4 ( Marks: 1 ) - Please choose one

To create semaphore objects which function use by thread?

► CreateSemaphore() ► CreateSemaobject() ► CreateObject()

www.vustudents.ning.com

www.vustudents.ning.com

► Create() Question No: 5 ( Marks: 1 ) - Please choose one

RFC stands for

► Request for comments

► Request of connects

► Reference for connect

► Request for cancels

Question No: 6 ( Marks: 1 ) - Please choose one

When every any GDI function call is made or send message or post message function calls are made then which queuing will create?

► Message Queuing

► Function Queuing

► Process Queuing

► None of the given

Question No: 7 ( Marks: 1 ) - Please choose one

Copy-on-write protection is an optimization that allows multiple processes to map theirvirtual address spaces such that they share a physical page until one of the processesmodifies the page. This definition belongs to which technique.

► Lazy evaluation

► Fast evaluation

► Process evaluation

► None of the given

Question No: 8 ( Marks: 1 ) - Please choose one

www.vustudents.ning.com

www.vustudents.ning.com

If the dialog box procedure returns FALSE, then which message handling will be performed?

► Default

► Instance

► Object

► None of the given

Question No: 9 ( Marks: 1 ) - Please choose one

How many parameters take the dialog box procedure?

► 1 ► 0 ► 6 ► 4 Question No: 10 ( Marks: 1 ) - Please choose one

What does hmenu mean?

► Handle to window

► Handle to the menu

► Handle to child window

► Handle to highest menu

Question No: 11 ( Marks: 1 ) - Please choose one

When the system sends the item's identifier to the owner window?

► When the user chooses a command item from a menu

► When the system chooses a command item from a menu

► When the user click on any window area

► When the system de-select the item menu

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 12 ( Marks: 1 ) - Please choose one

If the load menu function fails so what will be the return value.

► 0

► False

► Null

► 1

Question No: 13 ( Marks: 1 ) - Please choose one

Who generate a unique handle for each menu?

► System

► User

► Dialog box

► Menu Items

Question No: 14 ( Marks: 1 ) - Please choose one

Which message function determined where to send message.

None of the given

► DispatchMessage ► MessageDispatch ► GetMessage ► None of the given

Question No: 15 ( Marks: 1 ) - Please choose one

In 32-bit windows programming, we are freed from the curse of 64k segments.

www.vustudents.ning.com

www.vustudents.ning.com

► True ► False Question No: 16 ( Marks: 1 ) - Please choose one

Which function we use to register windows classes in window?

► RegisterClass(); ► RegistersClass(); ► RegisterWin(); ► WinReg(); Question No: 17 ( Marks: 1 ) - Please choose one

Which operator manipulates individual bits?

► Individual Bits

► Linked Bits

► Individual Bytes

► Linked Bytes

Question No: 18 ( Marks: 1 ) - Please choose one

Union Person{char name[30]; //30 bytesint age;float height;};How many bytes will skip after executing ptr = ptr +1.Union Person abc, *ptr;Ptr = &abc;ptr = ptr +1;

www.vustudents.ning.com

www.vustudents.ning.com

► 30 bytes will skip after executing ptr = ptr +1. ► 31 bytes will skip after executing ptr = ptr +1. ► 32 bytes will skip after executing ptr = ptr +1. ► 38 bytes will skip after executing ptr = ptr +1. Question No: 19 ( Marks: 1 ) - Please choose one

double *ptr is pointer variable which stores double type address.

► True ► False Question No: 20 ( Marks: 1 ) - Please choose one

____________ is/are type(s) of macro. ► Object-like macro ► Function-like macro ► All of the given ► None of the given Question No: 21 ( Marks: 1 ) - Please choose one

Which of the following is not true about HTTP? ► It is a protocol ► It is stateless ► It is more difficult to implement than state-aware protocols ► A web browser is HTTP client Question No: 22 ( Marks: 1 ) - Please choose one

For TCP/IP, if the port is specified as zero, the service provider assigns a unique port to the application with a value between ________________. ► 1 and 1024 ► 1 and 4000 ► 1024 and 5000 ► 1024 and 10240

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 23 ( Marks: 1 ) - Please choose one

All bits in high word of a 32-bit pointer are ____________. ► Non-zero ► Zero ► Two ► None of the given Question No: 24 ( Marks: 1 ) - Please choose one

An accelerator _____________ to correspond to a menu command. ► Needs ► Needs not ► Is essential ► Is necessary Question No: 25 ( Marks: 1 ) - Please choose one

CGI stands for: ► Control Graphics Interface ► Common Graphics Interface ► Control Gateway Interface ► Common Gateway Interface Question No: 26 ( Marks: 1 ) - Please choose one

Which one of the following operations is common to both client and server sockets: ► Send ► Connect ► Accept ► Bind Question No: 27 ( Marks: 1 ) - Please choose one

DLU is: ► Handle of a dialog ► Handle of a modal dialog only ► Measure of distance within a dialog box ► Name of a dialog Question No: 28 ( Marks: 1 ) - Please choose one

Neither the user nor the application can make the owner window active until the _______ is destroyed. ► Modeless dialog box ► Modal dialog box

www.vustudents.ning.com

www.vustudents.ning.com

► Child control ► All of the given Question No: 29 ( Marks: 1 ) - Please choose one

When a menu item is clicked, __________ message is sent. ► WM_MENUITEMCLICKED ► WM_MENUCLICKED ► WM_COMMAND ► WM_PAINT Question No: 30 ( Marks: 1 ) - Please choose one

How many WM_CHAR messages will be generated when Shift+A key combination is pressed from keyboard and we haven’t called TranslateMessage() before calling DispatchMessage() function? ► 0 ► 1 ► 2 ► 3 Question No: 31 ( Marks: 2 )

What is a process? Question No: 32 ( Marks: 2 )

What is HTTP? Question No: 33 ( Marks: 2 )

Briefly define Modal Loop? Question No: 34 ( Marks: 3 )

Define briefly Group Box? Question No: 35 ( Marks: 3 )

Which are the three parts of name when using internet address family? Question No: 36 ( Marks: 3 )

Define the names of resource-definition statements’ categories? Question No: 37 ( Marks: 5 )

www.vustudents.ning.com

www.vustudents.ning.com

State three differences between a Window Procedure and a Dialog Procedure? Question No: 38 ( Marks: 5 )

Define the purpose of connect function with syntax. What does it return?

Question No: 39 ( Marks: 10 )

Define Dynamic Link Libraries in detail? Also explain its relation with memory management? Question No: 40 ( Marks: 10 )

Show the flow of server and client socket calls using block diagram?

CS410 Visual Programming

Final Term Examination – Spring 2005

Time Allowed: 150 Minutes

Please read the following instructions carefully before

attempting any of the questions:

1. Attempt all questions. Marks are written adjacent to each

question.

2. Do not ask any questions about the contents of this

examination from anyone.

a. If you think that there is something wrong with any of

the questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is

missing, make an appropriate assumption and use it to

solve the problem.

c. Write all steps, missing steps may lead to deduction of

marks.

www.vustudents.ning.com

www.vustudents.ning.com

**WARNING: Please note that Virtual University takes serious

note of unfair means. Anyone found involved in cheating will

get an `F` grade in this course.

Total Marks: 50 Total Questions: 10

Question No. 1 Marks : 02

Windows common controls are implemented in

o

o Kernel32.dll

Comctl32.dll

o User32.dll

o Gdi32.dll

Question No. 2 Marks : 14

Write pseudo code of a complete program that creates a check box in such a way that on

clicking the right mouse button to the check box, it displays a message box that shows a

message "right button is clicked". In order to do that you are required to re-use the

appropriate system window class and make necessary changes in it before registering

again. Also write appropriate function calls and parameters in each step and explain each

step clearly.

Question No. 3 Marks : 05

Write the necessary steps to explicitly associate a resource with an application without

www.vustudents.ning.com

www.vustudents.ning.com

using the resource editor options?

Question No. 4 Marks : 02

The application can load its resources when

o res file is compiled

o

o res file is linked to the executable file

rc file is compiled and but not linked yet

o resource.h file is included

o None of the above

Question No. 5 Marks : 03

Why web servers are required to send MIME type in case of an HTTP reply?

Question No. 6 Marks : 05

How can a dialog be centred? Explain it with example and appropriate function call.

Question No. 7 Marks : 02

It is not possible to define our own window messages.

o True

www.vustudents.ning.com

www.vustudents.ning.com

o False

Question No. 8 Marks : 04

How can a combo box be added to the toolbar? Write appropriate function.

Question No. 9 Marks : 02

What information about the resources is placed in resource.h?

o Definitions

o

o Data structures

Identifiers

o Editors

o Size

Question No. 10 Marks : 02

Child window is confined to its parent's client area only.

o True

o False

Question No. 11 Marks : 05

Explain the basic difference(s) between a message box and a dialog box.

Question No. 12 Marks : 02

www.vustudents.ning.com

www.vustudents.ning.com

WM_INITDIALOG message is sent by the system:

o Before creating the dialog

o

o Before creating dialog and after displaying it

After creating and displaying the dialog

o After creating the dialog and before making it visible

o None of the above

Question No. 13 Marks : 02

What is the first step the application should do to draw, in a window without using

WM_PAINT message?

o

o Quit device context

Release device context

o Retrieve device context

o Οutline the shape to be drawn

o Set the background color of the window

Question No. 14 Marks : 04

Explain why all the application related messages come directly to the modal dialog box if

it is active and not through its owner window's window procedure?

Question No. 15 Marks : 02

www.vustudents.ning.com

www.vustudents.ning.com

Identify the function which is used to change an existing item of the menu at run time

o AppendMenu

o InsertMenu

o

o SetMenuItemInfo

ChangeMenu

o AddMenuItemInfo

Question No. 16 Marks : 04

What are the benefit(s) of declaring a resource as DISCARDABLE?

FINALTERM EXAMINATION

SPRING 2006

CS410 - VISUAL PROGRAMMING (Session - 1 )

Marks: 50

Time: 120min

StudentID/LoginID: ______________________________

Student Name: ______________________________

Center Name/Code: ______________________________

Exam Date: Wednesday, August 16, 2006

www.vustudents.ning.com

www.vustudents.ning.com

Please read the following instructions carefully before attempting any

of the questions:

1. Attempt all questions. Marks are written adjacent to each question.

2. Do not ask any questions about the contents of this examination

from anyone.

a. If you think that there is something wrong with any of the

questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is

missing, make an appropriate assumption and use it to solve the

problem.

c. Write all steps, missing steps may lead to deduction of marks.

3. You can consult your handouts while solving the paper.

4. The paper is tool independent.

**WARNING: Please note that Virtual University takes serious note of unfair means.

Anyone found involved in cheating will get an `F` grade in this course.

For Teacher's use only

Question 1 2 3 4 5 6 7 8 9 10 Total

Marks

Connecting VU Students Question 11 12

Marks

Question No: 1 ( Marks: 2 ) - Please choose one

When we use PostThreadMessage for a thread that has not message queue then:

www.vustudents.ning.com

www.vustudents.ning.com

Nothing will happen

It will cause a run time error

Thread will resume processing

Its message queue will be created

None of the given options

Question No: 2 ( Marks: 2 ) - Please choose one

When a dialog box is created which one of the following messages is generated?

WM_CREATE

WM_DIALOGCREATE

www.vustudents.ning.com

www.vustudents.ning.com

WM_INITDIALOG

WM_COMMAND

WM_DIALOGCOMMAND

Question No: 3 ( Marks: 2 ) - Please choose one

TreeView control is created using:

CreateWindow function

CreateWindowEx function

CreateControl function

www.vustudents.ning.com

www.vustudents.ning.com

None of the given options

CreatTreeView function

Question No: 4 ( Marks: 2 ) - Please choose one

Menu resource should be associated with a window while:

Creating window

Registering window

Repainting window

Creating or registering window

Destroying window

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 5 ( Marks: 2 ) - Please choose one

Which of the following is an application defined message:

WM_COMMAND

WM_SYSCOMMAND

WM_CREATE

WM_QUIT

WM_USER

Question No: 6 ( Marks: 5 )

We have an application in which there is a function named “TestingFunction”. There are

2 local

integer variables declared in it. One is named “simpleVariable” and other is named

www.vustudents.ning.com

www.vustudents.ning.com

“staticVariable”. The storage class of “staticVariable” is static. Suppose this function is

called and

when it returns the value of “simpleVariable” is lost but that of “staticVariable” is

preserved. Why

is it so?

Question No: 7 ( Marks: 5 )

Suppose we have called TranslateMessage function before calling DispatchMessage to

handle

messages. Write down the message sequence sent to the windows procedure when

Shift+S keys are

pressed.

Question No: 8 ( Marks: 5 )

Suppose an application has a window and 2 menu resources, one is IDM_MENU1 and

second is

IDM_MENU2. While registering the window class in this application, we make

IDM_MENU1 the

class menu. Now, we have 2 scenarios:

1. We give the menu handle of IDM_MENU2 during creating the window.

2. We give NULL as the menu during creating the window.

You have to tell which menu will be associated to the window in both cases.

Question No: 9 ( Marks: 5 )

We have 128MB RAM in our system. Suppose we run a Win32 application that declares

an array

of 800MB whose each element is of 512KB. How will operating system handle the

situation when

the application requests 10 elements of that array?

www.vustudents.ning.com

www.vustudents.ning.com

Question No: 10 ( Marks: 5 )

Suppose we have 2 menu items named “Show” and “Clear”. Their identifiers are

ID_FILE_SHOW

and ID_FILE_CLEAR respectively. Write down the resource statements to add

accelerators for

these menu items.

Question No: 11 ( Marks: 10 )

Write WinMain and window procedure of an application that creates an overlapped

window with 2

buttons. One button has text “Width” printed on it and when it is clicked it displays the

width of

window’s client area through message box while the other button has text “Height”

printed on it

and when clicked displays the height of window’s client area through message box.

Note: To convert a long value into string, simply use LongToString function.

e.g. If “ClientHeight” is a long variable and “strClientHeight” is a string variable then to

convert the value of “ClientHeight” to string and store it in “strClientHeight” proceed as

follows:

LongToString(ClientHeight);

(This function will not run on Visual C++ or Dev C++ compilers)

Question No: 12 ( Marks: 5 )

An application whose primary thread’s entry point is WinMain creates another thread

using

CreateThread function. Security Attribute parameter is set to NULL, stack size is 512KB

and

www.vustudents.ning.com

www.vustudents.ning.com

thread function is MyFunction. What would be the entry point and exit point of this

secondary

thread?

Windows Programming CS410

Total 52 questions

Total 80 marks

Total time 120 minutes

40 MCQs from all lectures but last 10 lectures were most important.

1. Socket operations (5 marks)

2. Code to handle Shift + S (5 marks)

3. Use of Translate message and Dispatch message. (5 marks)

4. Responsibilities of Kernel. (5 marks)

5. How to send message? example. (3 marks)

6. Disadvantages of threads. (3 marks)

7. Difference between simple window program and DLL. (3 marks)

8. What is CGI? (3 marks)

9. What will be the output of the given code. (2 marks)

10. What is handle to menu? (2 marks)

11. Which function is used to create window class? (2 marks)

12. There was question regarding semaphore. (2 marks)

Cs410 Final Exam date 10-08-2010What is meant by dialog unit? 2What is custom resource? 2When does “RegisterClass()” return null? 2What is meant by “Static web contents” ? 2What is the important of TranslateMessage() function? 3What is meant by web browser? Explain its working. 3Define briefly Group Box 3What is semaphore object and what is does? 5

www.vustudents.ning.com

www.vustudents.ning.com

List some of the uses of dialogs. 5We have an application in which we want to capture Ctrl+S key combination. Write down the mechanism to detect whether Ctrl key is down or not when S key is down. Note that we are not using any accelerator. 5

www.vustudents.ning.com