Click here to Skip to main content
15,894,291 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: performance of C,C++ programs Pin
Ștefan-Mihai MOGA4-Apr-06 3:11
professionalȘtefan-Mihai MOGA4-Apr-06 3:11 
AnswerRe: performance of C,C++ programs Pin
toxcct4-Apr-06 3:42
toxcct4-Apr-06 3:42 
QuestionMarshalling Pin
viperlogic4-Apr-06 2:36
viperlogic4-Apr-06 2:36 
AnswerRe: Marshalling Pin
Roger Stoltz4-Apr-06 3:03
Roger Stoltz4-Apr-06 3:03 
GeneralRe: Marshalling Pin
viperlogic4-Apr-06 3:22
viperlogic4-Apr-06 3:22 
GeneralRe: Marshalling Pin
YaronNir4-Apr-06 4:00
YaronNir4-Apr-06 4:00 
AnswerRe: Marshalling Pin
Roger Stoltz4-Apr-06 4:01
Roger Stoltz4-Apr-06 4:01 
Questionproblem in OnDraw Pin
Anu_Bala4-Apr-06 2:34
Anu_Bala4-Apr-06 2:34 
Hi,
I have to draw line in screen.
I tried a lot of things,but it does not draw.Following functions i used in my codings.

void CPerfGrapView::OnDraw(CDC* pDC)
{

// TODO: add draw code here
GetClientRect(&mClientArea);

pMemDC->FillRect(&mClientArea,&CBrush(RGB(66,60,66)));

pMemDC->SetBkMode(TRANSPARENT);

CFont *pOFont = pMemDC->SelectObject(&TextFont);
if(!pOFont)
{
AfxMessageBox(IERR_GDIFAIL);
return;
}


CPen *pOPen = pMemDC->SelectObject(&penGraph);



pMemDC->SetBkColor(RGB(0,0,0));
pMemDC->SetTextColor(RGB(255,255,255));
pMemDC->TextOut(::AlignX(300,mClientArea),::AlignY(30,mClientArea),"Perfor");
pMemDC->SelectObject(&penGraph);
//pMemDC->TextOut(500,400,"PERFORMANCE GRAPH VIEW");

}

///
int CPerfGrapView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
pMemDC = new CDC;
if(!pMemDC)
{
AfxMessageBox(IERR_MEMFAIL);
return -1;
}
pBitmap = new CBitmap;
if(!pBitmap)
{
AfxMessageBox(IERR_MEMFAIL);
return -1;
}
CDC *pDC = GetDC();
pMemDC->CreateCompatibleDC(pDC);
pBitmap->CreateCompatibleBitmap (pDC, 800, 640 );
pMemDC->SelectObject( pBitmap );

if(!TextFont.CreateFont(14,0,0,0,400,FALSE,FALSE,0,ANSI_CHARSET,
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,DEFAULT_PITCH|FF_ROMAN,NULL))
{
AfxMessageBox(IERR_GDIFAIL);
return -1;
}

if(!penGraph.CreatePen(NULL,NULL,RGB(255,255,255)))
{
AfxMessageBox(IERR_GDIFAIL);
return -1;
}

ReleaseDC(pDC);
return 0;
}

BOOL CPerfGrapView::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBrush brBkGround(RGB(66,60,66));
CBrush brBkGround(RGB(0,0,0));
CBrush *pbrOld = pDC->SelectObject(&brBkGround);
CRect rc;
pDC->GetClipBox(&rc);
pDC->PatBlt(rc.left, rc.top, rc.Width(),rc.Height(), PATCOPY);
pDC->SelectObject(pbrOld);
return TRUE;
//return CView::OnEraseBkgnd(pDC);
}
I declared all variables in my header file.
This is my Coding.But it does not draw anything in screen.Can u find it.
It simply shows the Blank Background.


AnswerRe: problem in OnDraw Pin
Cedric Moonen4-Apr-06 2:49
Cedric Moonen4-Apr-06 2:49 
AnswerRe: problem in OnDraw Pin
Hamid_RT4-Apr-06 3:15
Hamid_RT4-Apr-06 3:15 
Questionhardware identify in linux operating system Pin
ss20064-Apr-06 2:25
ss20064-Apr-06 2:25 
AnswerRe: hardware identify in linux operating system Pin
Ștefan-Mihai MOGA4-Apr-06 2:44
professionalȘtefan-Mihai MOGA4-Apr-06 2:44 
QuestionIs there any way to mix audio and video files? Pin
atimpoo4-Apr-06 2:10
atimpoo4-Apr-06 2:10 
AnswerRe: Is there any way to mix audio and video files? Pin
Ștefan-Mihai MOGA4-Apr-06 2:20
professionalȘtefan-Mihai MOGA4-Apr-06 2:20 
QuestionVisual Leak Detector Prob Pin
thepersonof4-Apr-06 1:32
thepersonof4-Apr-06 1:32 
AnswerRe: Visual Leak Detector Prob Pin
Cedric Moonen4-Apr-06 1:44
Cedric Moonen4-Apr-06 1:44 
GeneralRe: Visual Leak Detector Prob Pin
thepersonof4-Apr-06 1:51
thepersonof4-Apr-06 1:51 
GeneralRe: Visual Leak Detector Prob Pin
Cedric Moonen4-Apr-06 2:03
Cedric Moonen4-Apr-06 2:03 
GeneralRe: Visual Leak Detector Prob Pin
toxcct4-Apr-06 2:19
toxcct4-Apr-06 2:19 
GeneralRe: Visual Leak Detector Prob Pin
Cedric Moonen4-Apr-06 2:22
Cedric Moonen4-Apr-06 2:22 
AnswerRe: Visual Leak Detector Prob Pin
toxcct4-Apr-06 1:56
toxcct4-Apr-06 1:56 
QuestionHow can i listen to all IRP from PnP on USB port? Pin
fcoder4-Apr-06 0:43
fcoder4-Apr-06 0:43 
AnswerRe: How can i listen to all IRP from PnP on USB port? Pin
Cedric Moonen4-Apr-06 1:47
Cedric Moonen4-Apr-06 1:47 
AnswerRe: How can i listen to all IRP from PnP on USB port? Pin
kakan4-Apr-06 2:02
professionalkakan4-Apr-06 2:02 
GeneralRe: How can i listen to all IRP from PnP on USB port? Pin
fcoder4-Apr-06 18:10
fcoder4-Apr-06 18:10 

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.