Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GetCurrentDirectory() any soln for this ? Pin
Hamid_RT18-Dec-06 19:15
Hamid_RT18-Dec-06 19:15 
GeneralRe: GetCurrentDirectory() any soln for this ? Pin
Naveen18-Dec-06 18:32
Naveen18-Dec-06 18:32 
AnswerRe: GetCurrentDirectory() any soln for this ? Pin
Hamid_RT18-Dec-06 17:54
Hamid_RT18-Dec-06 17:54 
Questionprogram cannot execute.. Pin
cyn818-Dec-06 16:03
cyn818-Dec-06 16:03 
AnswerRe: program cannot execute.. Pin
Hamid_RT18-Dec-06 18:01
Hamid_RT18-Dec-06 18:01 
GeneralRe: program cannot execute.. Pin
cyn818-Dec-06 18:04
cyn818-Dec-06 18:04 
GeneralRe: program cannot execute.. Pin
Hamid_RT18-Dec-06 18:13
Hamid_RT18-Dec-06 18:13 
GeneralRe: program cannot execute.. Pin
cyn818-Dec-06 18:36
cyn818-Dec-06 18:36 
Here is the code..but this is oni will draw lines.
////////this is testctrl.cpp//////////////////
void testctrl::OnPaint()
{

CPaintDC dc(this); // device context for painting

}



//////////////////////////////////
// Do not call CPropertyPage::OnPaint() for painting messages




void testctrl::Draw(CDC *pDC)
{
CRect rect;
CPen penBlack;
penBlack.CreatePen(PS_SOLID, 0, RGB(0,255,0));
CPen* pOldPen=pDC->SelectObject(&penBlack);
GetClientRect(rect);
int vectorValues[] = {1,1,0,0,1,1}; // for testing
int m_currentXCoord=0;


int width=10;
for(int i = 0; i < 19; i++)
{
if(vectorValues[i] == 1)
{
pDC->MoveTo(m_currentXCoord,10);
pDC->LineTo(m_currentXCoord+width,10);
m_currentXCoord = m_currentXCoord + width;
}

else

{
pDC->MoveTo(m_currentXCoord,20);
pDC->LineTo(m_currentXCoord+width,20);
m_currentXCoord = m_currentXCoord + width;

} // a 0 so only update X coordinate
}


pDC->SelectObject(pOldPen);
}

BOOL testctrl::OnEraseBkgnd(CDC* pDC)
{
// To avoid flickering
return CWnd::OnEraseBkgnd(pDC);
// return TRUE;
}
/////////////////////////////////////////////////


/////////////this is testdlg.cpp/////////////////////
void CTestDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CDC dc;
m_custom.Draw(&dc);
UpdateData(FALSE);
UpdateDialogControls(this,FALSE);
}

void CTestDlg::OnUpdateStart(CCmdUI* pCmdUI)
{
pCmdUI->Enable(TRUE);
}
/////////////////////////////////////////////////
thanks for ur help

GeneralRe: program cannot execute.. Pin
Hamid_RT18-Dec-06 18:44
Hamid_RT18-Dec-06 18:44 
AnswerRe: program cannot execute.. [modified] Pin
prasad_som18-Dec-06 20:08
prasad_som18-Dec-06 20:08 
GeneralRe: program cannot execute.. Pin
Hamid_RT18-Dec-06 20:31
Hamid_RT18-Dec-06 20:31 
GeneralRe: program cannot execute.. Pin
Hamid_RT19-Dec-06 7:25
Hamid_RT19-Dec-06 7:25 
Questionto reduce footprint Pin
George_George18-Dec-06 15:51
George_George18-Dec-06 15:51 
AnswerRe: to reduce footprint Pin
Paul Conrad25-Dec-06 19:01
professionalPaul Conrad25-Dec-06 19:01 
GeneralRe: to reduce footprint Pin
George_George27-Dec-06 6:09
George_George27-Dec-06 6:09 
GeneralRe: to reduce footprint [modified] Pin
Paul Conrad27-Dec-06 6:18
professionalPaul Conrad27-Dec-06 6:18 
GeneralRe: to reduce footprint Pin
George_George30-Dec-06 7:18
George_George30-Dec-06 7:18 
GeneralRe: to reduce footprint Pin
Paul Conrad30-Dec-06 7:27
professionalPaul Conrad30-Dec-06 7:27 
GeneralRe: to reduce footprint Pin
George_George4-Jan-07 18:42
George_George4-Jan-07 18:42 
QuestionValidate and Invalidate in RedrawWindow() [modified] Pin
rp_suman18-Dec-06 15:22
rp_suman18-Dec-06 15:22 
AnswerRe: Validate and Invalidate in RedrawWindow() Pin
Stephen Hewitt18-Dec-06 15:41
Stephen Hewitt18-Dec-06 15:41 
AnswerRe: Validate and Invalidate in RedrawWindow() [modified] Pin
prasad_som18-Dec-06 17:59
prasad_som18-Dec-06 17:59 
GeneralRe: Validate and Invalidate in RedrawWindow() Pin
rp_suman18-Dec-06 19:21
rp_suman18-Dec-06 19:21 
GeneralRe: Validate and Invalidate in RedrawWindow() Pin
rp_suman19-Dec-06 21:31
rp_suman19-Dec-06 21:31 
AnswerRe: Validate and Invalidate in RedrawWindow() Pin
prasad_som27-Dec-06 18:08
prasad_som27-Dec-06 18:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.