Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: get number from string Pin
Nish Nishant20-Mar-03 17:22
sitebuilderNish Nishant20-Mar-03 17:22 
Generalpointer's high bit Pin
Phil Hamer20-Mar-03 14:50
Phil Hamer20-Mar-03 14:50 
GeneralRe: pointer's high bit Pin
Tim Smith20-Mar-03 15:31
Tim Smith20-Mar-03 15:31 
GeneralRe: pointer's high bit Pin
John M. Drescher20-Mar-03 16:12
John M. Drescher20-Mar-03 16:12 
Generalbitmapp action Pin
el davo20-Mar-03 13:19
el davo20-Mar-03 13:19 
GeneralRe: bitmapp action Pin
Brian Shifrin20-Mar-03 15:32
Brian Shifrin20-Mar-03 15:32 
GeneralRe: bitmapp action Pin
el davo20-Mar-03 15:42
el davo20-Mar-03 15:42 
GeneralRe: bitmapp action Pin
el davo20-Mar-03 17:46
el davo20-Mar-03 17:46 
Ok the entire section i have is:

BOOL CGraphStatic::SetBitmap(CDC *pDC)
{
CBitmap *pOldBmp;
CRect rect, thisRect;
CWnd *pWnd;

if(pDC==NULL)
{
AfxMessageBox("DC Not Found");
return FALSE;
}

pWnd = pDC->GetWindow(); //Get Window of PDC

pWnd->GetClientRect(&rect); //Get dimension of Window

CDC memdc;

memdc.CreateCompatibleDC(pDC); //Make Compatible DC for memdc
m_bmDisplay.CreateCompatibleBitmap(pDC,rect.Width(),rect.Height());
//Create Compatible DDB
pOldBmp=memdc.SelectObject(&m_bmDisplay);
memdc.BitBlt(0,0,rect.Width(),rect.Height(),pDC,0,0,SRCCOPY);
memdc.SelectObject(pOldBmp);

m_bmDisplay.GetObject(sizeof(m_bmInfoDisplay), &m_bmInfoDisplay);

this->GetClientRect(&thisRect);

rect.right = rect.left + m_bmInfoDisplay.bmWidth + 2;
rect.bottom = rect.top + m_bmInfoDisplay.bmHeight + 2;

SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(), SWP_NOZORDER | SWP_NOMOVE);

m_bAssigned = TRUE;

return TRUE;
}

and,

in my OnPaint function for the static control (the draw struct code borrowed from somewhere, can't recall where)

if (m_bAssigned == TRUE){
if (m_cdcBufDisplay.bValid == FALSE)
{
m_cdcBufDisplay.dcMemory.CreateCompatibleDC(&dc);
m_cdcBufDisplay.pOldBmp = m_cdcBufDisplay.dcMemory.SelectObject(&m_bmDisplay);
m_cdcBufDisplay.bValid = TRUE;
}

dc.BitBlt(0, 0, m_bmInfoDisplay.bmWidth, m_bmInfoDisplay.bmHeight, &m_cdcBufDisplay.dcMemory, 0, 0, SRCCOPY);
}

If i call setbitmap on dialog initialisation, i will get at least something in the control, but anywhere else and nothing gets drawn Frown | :(


Cheers,

Dave
GeneralRe: bitmapp action Pin
Brian Shifrin20-Mar-03 23:53
Brian Shifrin20-Mar-03 23:53 
GeneralRe: bitmapp action Pin
el davo23-Mar-03 12:12
el davo23-Mar-03 12:12 
GeneralRe: bitmapp action Pin
John R. Shaw21-Mar-03 11:42
John R. Shaw21-Mar-03 11:42 
Questionmodifying auto ip timeout? Pin
gjwkim20-Mar-03 13:13
gjwkim20-Mar-03 13:13 
GeneralTHIS SITE IS DANGEROUS!!!! Pin
Anonymous20-Mar-03 12:42
Anonymous20-Mar-03 12:42 
GeneralExact DataStructure Pin
Anonymous20-Mar-03 11:26
Anonymous20-Mar-03 11:26 
Questionhow to set item for a listbox Pin
liquidsnake18320-Mar-03 11:22
liquidsnake18320-Mar-03 11:22 
AnswerRe: how to set item for a listbox Pin
valikac20-Mar-03 12:16
valikac20-Mar-03 12:16 
AnswerRe: how to set item for a listbox Pin
Dave Bryant20-Mar-03 12:20
Dave Bryant20-Mar-03 12:20 
GeneralPassing arrays to functions(Simple question)! Pin
Paddy20-Mar-03 11:13
Paddy20-Mar-03 11:13 
GeneralRe: Passing arrays to functions(Simple question)! Pin
João Paulo Figueira20-Mar-03 11:25
professionalJoão Paulo Figueira20-Mar-03 11:25 
GeneralRe: Passing arrays to functions(Simple question)! Pin
Paddy20-Mar-03 11:58
Paddy20-Mar-03 11:58 
GeneralUnexpected Delay in TCP Streams Pin
SanShou20-Mar-03 10:18
SanShou20-Mar-03 10:18 
GeneralODBC and CListCtrl Pin
Anonymous20-Mar-03 10:14
Anonymous20-Mar-03 10:14 
QuestionCreate Report in Access? Pin
Aaron Schaefer20-Mar-03 9:59
Aaron Schaefer20-Mar-03 9:59 
GeneralEndDialog() for modal Pin
ns20-Mar-03 9:09
ns20-Mar-03 9:09 
GeneralRe: EndDialog() for modal Pin
Alvaro Mendez20-Mar-03 9:31
Alvaro Mendez20-Mar-03 9:31 

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.