We are Permanently Move to www.VUpk.net Please Join us there.
Showing posts with label CS410. Show all posts
Showing posts with label CS410. Show all posts

CS410 Final term Subjective Paper 2012

Sunday, 12 August 2012

CS410 - Visual Programming Subjective Questions from Final Exam 2012

2 Marks Questions
Q. What is Bind Function?
Q. What is the purpose of Pager control?
Q. What is the Mean by Resource definition Statement?
Q. Why static variables are not destroyed when function returns?
3 Marks Questions
Q. Some usages of Dialog
Q. How Transfer-Encoding is implemented in Exchange-2000.
Q. My Application uses impression and user interface show up in a different Language then the current user’s environment. How can I fix the mixed UI?
5 Marks Questions
Q. How do I restrict my windows so it can’t be resized longer or smaller then a certain size?
Q. If you include CS_DBLCLKS in your window call style, the windows procedure receives which message for double click. ( Specify exact sequence).
Q. Write a recursive function definition for the following function.
Int square (int n);
// Precondition : n>1
// Return the sum of dqure of number 1 through n
For example square of 3 returns 14 because 12 + 22 + 32 is 14

CS410 Mid term Subjective Paper 2011

CS410-Visual Programming-Midterm-Subjective-Paper(28-11-2011)


  • It is sometimes more efficient for an application to draw directly in a window without relying on the WM_PAINT message. How this task can be accomplished (i.e. how can we draw in a window directly without using WM_PAINT message)? (5)
  • Write down a C/C++ program that has 2 functions. One takes four integer variables as parameters and returns their sum and the other also takes 4 integers as argument and returns their multiplication. Also write 2 macros that perform the same tasks as these functions perform.(5)
  • How can I use the CopyTo method of the Windows Forms controls collection to copy controls into an array? (3)
  • How Windows keep track of the files?(3)
  • Can you write a class without specifying namespace? Which namespace does it belong to by default?(2)
  • "In the GDI environment there are two working spaces", Name these two. (2)

CS410 GDB Solution Spring 2012

Thursday, 5 July 2012
 CS410 GDB Solution Spring 2012

Why it is important to study detailed code or functions of windows / visual programming, rather there are many professional tools like Visual Studio etc. available that do the same in mush less time as compared to write a detailed code.
Solution:
Advantages of using professional tools like Visual Studio etc.
  • Good debuggers
  • Editing running code(when available)
  • Advanced code refactoring capabilities
  • Plugins for source control etc.
  • Automatic error checking, auto-completion etc.

CS410 Assignment No 4 Spring 2012 solution

Monday, 2 July 2012
CS410 Assignment No 4 Spring 2012 solution

Task 1: (Marks = 2)
Draw a simple Window using ‘windows.h’

Task 2: (Marks = 8 (1 + 1 + 2 + 2 + 2))
When program will execute,
1 – Windows Title Bar has text as your VU ID.
2 – In client area, first line of the windows have your name as Name = XYZ       *Replace XYZ with your Name
3 – In next line, a Solid line would be appeared.
4 – After that, Text ‘Current Semester Registered Courses’ will appear. And in next line to that, there will be a dash line.
5 – After step 4, Courses ID with Course names would be displayed (One Course Code and Name per line).
6 – At last, a line is drawn with pattern brush to finish your task.

Sample output screen shot is provided below;


Solution:
#include <windows.h>
LRESULT CALLBACK WndProc(
HWND hWnd,
UINT msg,
WPARAM wParam,
LPARAM lParam ) {
switch( msg ) {
case WM_PAINT: {
POINT pntArray[2];
pntArray[0].x=05;
pntArray[0].y=30;
pntArray[1].x=625;
pntArray[1].y=30;
POINT pntArraySec[2];
pntArraySec[0].x=05;
pntArraySec[0].y=90;
pntArraySec[1].x=625;
pntArraySec[1].y=90;
POINT pntArrayThird[2];
pntArrayThird[0].x=05;
pntArrayThird[0].y=250;
pntArrayThird[1].x=625;
pntArrayThird[1].y=250;
PAINTSTRUCT ps;
HDC hDC = BeginPaint( hWnd, &ps );
HPEN PenSolid=CreatePen(PS_SOLID, 2, RGB(0,0,0));
HPEN PenDash=CreatePen(PS_DASH, 1, RGB(0,0,0));
HPEN PenDastDot=CreatePen(PS_DASHDOT, 1, RGB(0,0,0));
TextOut(hDC, 20, 05, “Name: XYZ”, 9);
SelectObject(hDC,PenSolid);
Polyline(hDC, pntArray, 2);
TextOut(hDC, 20, 60, “Current Semester Registered Courses”, 35);
SelectObject(hDC,PenDash);
Polyline(hDC, pntArraySec, 2);
TextOut(hDC, 20, 120, “CS410 Visual Programming”, 34);
TextOut(hDC, 20, 140, “CS410 Visual Programming”, 34);
TextOut(hDC, 20, 160, “CS410 Visual Programming”, 34);
TextOut(hDC, 20, 180, “CS410 Visual Programming”, 34);
TextOut(hDC, 20, 200, “CS410 Visual Programming”, 34);
TextOut(hDC, 20, 200, “CS410 Visual Programming”, 34);
SelectObject(hDC,PenDastDot);
Polyline(hDC, pntArrayThird, 2);
EndPaint( hWnd, &ps );
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc( hWnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {
WNDCLASSEX wce;
wce.cbSize = sizeof(wce);
wce.style = CS_VREDRAW | CS_HREDRAW;
wce.lpfnWndProc = (WNDPROC) WndProc;
wce.cbClsExtra = 0;
wce.cbWndExtra = 0;
wce.hInstance = hInstance;
wce.hIcon = LoadIcon((HINSTANCE) NULL, IDI_APPLICATION);
wce.hCursor = LoadCursor((HINSTANCE) NULL, IDC_ARROW);
wce.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wce.lpszMenuName = 0;
wce.lpszClassName = “createClass”,
wce.hIconSm = 0;
if (!RegisterClassEx(&wce)) return 0;
HWND hWnd = CreateWindowEx(
0,
“createClass”,
“ABC123 (WRITE YOUR ROLL NUMBER HERE)”,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
650,
500,
NULL,
NULL,
hInstance,
NULL
);
ShowWindow( hWnd, nCmdShow );
MSG msg;
int r;
while ((r = GetMessage(&msg, NULL, 0, 0 )) != 0) {
if (r == -1) {
;
}
else {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
};
Related Posts Plugin for WordPress, Blogger...