Date | Time | Subject |
15-1-2010 Friday | 9:00 A.M. to 10:30 A.M. | P101 : OOP using VC++ |
2:00 P.M. to 3:30 P.M. | P102 : Web Technology Concepts | |
16-1-2010 Saturday | 9:00 A.M. to 10:30 A.M. | P103 : DBMS & Advanced Database Administration |
2:00 P.M. to 3:30 P.M. | P104 : O.S & Network Management | |
21-1-2010 Thursday | 9:00 A.M. Onwards | P105 : Project - I |
Monday, January 11, 2010
Practical Exam Program
Friday, January 8, 2010
Friday, December 4, 2009
Database Connection Using DAO in VC++
File Name :: DAOConnView.cpp
Coding ::
void CDAOConnView::OnMoveFirst()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MoveFirst();
UpdateData(FALSE);
}
void CDAOConnView::OnMovePrev()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MovePrev();
if(m_pSet->IsBOF() == TRUE)
{
MessageBox("First Record","Alert");
m_pSet->MoveFirst();
}
UpdateData(FALSE);
}
void CDAOConnView::OnMoveNext()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MoveNext();
if(m_pSet->IsEOF() == TRUE)
{
MessageBox("Last Record","Alert" );
m_pSet->MoveLast();
}
UpdateData(FALSE);
}
void CDAOConnView::OnMoveLast()
{
// TODO: Add your control notification handler code here
UpdateData();m_pSet->MoveLast();
}
void CDAOConnView::OnAdd()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->AddNew();
UpdateData(FALSE);
}
void CDAOConnView::OnSave()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->Update();
UpdateData(FALSE);
}
void CDAOConnView::OnUpdate()
{
// TODO: Add your control notification handler code here
m_pSet->Edit();
}
void CDAOConnView::OnDelete()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->Delete();
m_pSet->Requery();
m_pSet->MoveNext();
UpdateData(FALSE);
}
OLEDB CONNECTION IN VC++
public:
COledb_connectDoc* GetDocument();
bool flag;
COledb_connectView.cpp
void COledb_connectView::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_oledb_connectSet;
{
CWaitCursor wait;
HRESULT hr = m_pSet->Open();
if (hr != S_OK)
{
AfxMessageBox(_T("Record set failed to open."), MB_OK);
// Disable the Next and Previous record commands,
// since attempting to change the current record without an
// open RecordSet will cause a crash.
m_bOnFirstRecord = TRUE;
m_bOnLastRecord = TRUE;
}
}
m_rollno=m_pSet->m_rollno;
m_marks=m_pSet->m_marks;
COleDBRecordView::OnInitialUpdate();
}
void COledb_connectView::Onfirst()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MoveFirst();
m_rollno=m_pSet->m_rollno;
m_marks=m_pSet->m_marks;
UpdateData(false);
}
void COledb_connectView::Onlast()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MoveLast();
m_rollno=m_pSet->m_rollno;
m_marks=m_pSet->m_marks;
UpdateData(false);
}
void COledb_connectView::Oninsert()
{
// TODO: Add your control notification handler code here
UpdateData();
m_rollno=0;
m_marks=0;
UpdateData(false);
}
void COledb_connectView::Onsave()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->m_rollno=m_rollno;
m_pSet->m_marks=m_marks;
if(flag==true)//if flag is true then update operation will perform
{
m_pSet->SetData();
}
else //if flag is true then INSERT operation will perform
{
m_pSet->Insert();
}
flag=false;
UpdateData(false);
}
void COledb_connectView::Onnext()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MoveNext();
m_rollno=m_pSet->m_rollno;
m_marks=m_pSet->m_marks;
UpdateData(false);
}
void COledb_connectView::Onprevious()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->MovePrev();
m_rollno=m_pSet->m_rollno;
m_marks=m_pSet->m_marks;
UpdateData(false);
}
void COledb_connectView::Onupdate()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->m_rollno=m_rollno;
m_pSet->m_marks=m_marks;
m_pSet->Update();
flag=true;
UpdateData(false);
}
void COledb_connectView::Ondelete()
{
// TODO: Add your control notification handler code here
UpdateData();
m_pSet->Delete();
m_pSet->MoveFirst();
m_rollno=m_pSet->m_rollno;
m_marks=m_pSet->m_marks;
UpdateData(false);
}
Thursday, December 3, 2009
Practical Assignment
(9)
Monday, November 30, 2009
Dialog Box in The Shape of Circle

………....
Friday, November 27, 2009
Draw a Triangle
class CTriangleView : public CView
{
...
CPoint tr[3],ct;
int rad;
double rd;
CRect rc;
...
};
FileName : TriangleView.cpp
#include "math.h"
...
CTriangleView::CTriangleView()
{
// TODO: add construction code here
rd=0.0174532935;
}
void CTriangleView::OnDraw(CDC* pDC)
{
CTriangleDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
int i=0;
GetClientRect (rc);
ct.x = (rc.left + rc.right )/2;
ct.y = (rc.top + rc.bottom )/2;
rad=ct.x/2;
while(i<3)
{
tr[i].x = ct.x + rad * sin(i*120*rd);
tr[i].y = ct.y - rad * cos(i*120*rd);
i++;
}
pDC->Polygon (tr,3);
}
void CTriangleView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
int i=0;
CClientDC *pDC = new CClientDC (this);
ct.x = point.x;
ct.y = point.y;
rad=20;
while(i<3)
{
tr[i].x = ct.x + rad * sin(i*120*rd);
tr[i].y = ct.y - rad * cos(i*120*rd);
i++;
}
pDC->Polygon (tr,3);
CView::OnLButtonDown(nFlags, point);
}
Saturday, November 21, 2009
How to Change Cursor in VC++? Different Type of Cursor
public:
bool c1,c2,c3,c4;
*.cpp
void CCursor1View::OnMouseMove(UINT nFlags, CPoint point)
{
if(c1)
{
::SetCursor (::LoadCursor (NULL,IDC_CROSS));
}
else if(c2)
{
::SetCursor(::LoadCursor (NULL,IDC_APPSTARTING));
}
else if(c3)
{
::SetCursor (::LoadCursor (NULL,IDC_HELP));
}
else if(c4)
{
::SetCursor (::LoadCursor (NULL,IDC_WAIT));
}
}
void CCursor1View::OnMouseeventCross()
{
// TODO: Add your command handler code here
c1=true;
c2=false;
c3=false;
c4=false;
}
void CCursor1View::OnMouseeventAppstarting()
{
// TODO: Add your command handler code here
c1=false;
c2=true;
c3=false;
c4=false;
}
void CCursor1View::OnMouseeventHelp()
{
// TODO: Add your command handler code here
c1=false;
c2=false;
c3=true;
c4=false;
}
void CCursor1View::OnMouseeventWait()
{
// TODO: Add your command handler code here
c1=false;
c2=false;
c3=false;
c4=true;
}
you can also select this cursor:
1.IDC_APPSTARTING
2.IDC_ARROW
3.IDC_CROSS
4.IDC_HAND
5.IDC_HELP
6.IDC_ICON
7.IDC_NO
8.IDC_SIZE
9.IDC_SIZEALL
10.IDC_SIZENESW
11.IDC_SIZENS
12.IDC_SIZENWSE
13.IDC_SIZEWE
14.IDC_UPARROW
15.IDC_WAIT
Serialize : File Handling using CArchive
*.cpp
void CDLGSerializeDlg::OnWRITE()
{
// TODO: Add your control notification handler code here
CFile cf;
UpdateData();
cf.Open("D:\\test.txt",CFile::modeCreate|CFile::modeWrite);
CArchive ar(&cf,CArchive::store);
Serialize(ar);
//ar.WriteString(m_ftxt);
m_ftxt="";
ar.Flush();
cf.Close();
UpdateData(FALSE);
}
--read--
void CDLGSerializeDlg::OnREAD()
{
// TODO: Add your control notification handler code here
CFile cf;
//char data[50];
UpdateData();
cf.Open("D:\\test.txt",CFile::modeRead);
CArchive ar(&cf,CArchive::load);
Serialize(ar);
/*
ar.Read(data,cf.GetLength());
for(unsigned int i=0;i
}
}
Friday, November 20, 2009
VC++ Code For Drawing Analog and Digital Clock
//CGDIClockView.h
class CGDIClockView : public CView
{
...
// Attributes
public:
CString str;
bool start;
...
};
// CGDIClockView.cpp
CGDIClockView::CGDIClockView()
{
// TODO: add construction code here
start=false;
}
void CGDIClockView::OnStart()
{
// TODO: Add your command handler code here
start = true;
int x=125,y=125;
int a=125,b=50;
int r=75;
long int i=0,m=0,s=0,h=0;
int j=12;
double dtor=0.0174532935;
CClientDC *pDC = new CClientDC (this);
CPen cp;
cp.CreatePen(2,1,RGB(255,0,255));
pDC->SelectObject(&cp);
//Draw Clock
while(start)
{
cp.DeleteObject();
cp.CreatePen(PS_SOLID,1,RGB(0,0,0));
pDC->SelectObject(&cp);
//Code for Drawing Circle with Number 1 to 12
pDC->Ellipse (10,10,240,240);
while(i<360)
{
a = x - x * sin(i*dtor);
b = y - y * cos(i*dtor);
str.Format("%d",j);
pDC->TextOut(a-3,b-3,str);
j--;
i=i+30;
}
//Code for Drawing Second Hand
cp.DeleteObject();
cp.CreatePen(1,2,RGB(255,0,0));
pDC->SelectObject(&cp);
a = 125 + 110 * sin(s*dtor);
b = 125 - 110 * cos(s*dtor);
pDC->MoveTo(a,b);
pDC->LineTo(x,y);
//Code for Drawing Minute Hand
cp.DeleteObject();
cp.CreatePen(1,2,RGB(0,255,255));
pDC->SelectObject(&cp);
a = 125 + 90 * sin(m*dtor);
b = 125 - 90 * cos(m*dtor);
pDC->MoveTo(a,b);
pDC->LineTo(x,y);
//Code for Drawing Hour Hand
cp.DeleteObject();
cp.CreatePen(1,3,RGB(255,255,0));
pDC->SelectObject(&cp);
a = 125 + 70 * sin(h*dtor);
b = 125 - 70 * cos(h*dtor);
pDC->MoveTo(a,b);
pDC->LineTo(x,y);
s=s+6;
str.Format("Hour : %ld Min : %ld Second : %ld",((s/6)/3600)%24,((s/6)/60)%60,(s/6)%60);
pDC->TextOut (20,300," ",50);
pDC->TextOut (20,300,str);
Sleep(500);
//Code for Incrementing Value of Minute and Hour as per value of Seconds
if(s%360==0 && s>0)
{
m=m+6;
if(m%72==0 && m>0)
{
h=h+6;
}
}
//Code for Reseting All Values after 24 Hours
if(s==86400)
{
s=0;
}
Sleep(500);
UpdateWindow();
}
}
void CGDIClockView::OnStop()
{
// TODO: Add your command handler code here
start=false;
}
Wednesday, November 18, 2009
VC++ File Handling : Reading File from Particular Position Using Seek( ) Function

VC++ File Handling : Code for Reading And Writing Data from File.

void CFile1Dlg::OnWrite()
{
void CFile1Dlg::OnRead()
{
{
Tuesday, November 17, 2009
How to Write a Program in Exam?
Control Type | Control Name / ID | Member Variable Name | Variable Type | Validation / Extra Info. |
EditBox | IDC_EDIT1 | m_op1 | int | value in[0,100] |
EditBox | IDC_EDIT2 | m_op2 | int | value in[0,100] |
EditBox | IDC_EDIT3 | m_ans | int | value in[0,200] |
Button | IDOK | |||
Button | IDCANCEL |
Monday, November 16, 2009
VC++ (Visual C++) Program List for Submission

Submission Date : 15-Nov-2009

