Click here to Skip to main content
15,922,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem with variant Pin
dabs29-Nov-02 5:28
dabs29-Nov-02 5:28 
GeneralClick button on dialog box to open window. Pin
ooosawaddee328-Nov-02 23:18
ooosawaddee328-Nov-02 23:18 
GeneralRe: Click button on dialog box to open window. Pin
RicoH29-Nov-02 1:08
RicoH29-Nov-02 1:08 
GeneralEventViewer MMC Snap-in Pin
draman28-Nov-02 23:13
draman28-Nov-02 23:13 
GeneralAdding user-defined keywords Pin
RicoH28-Nov-02 22:32
RicoH28-Nov-02 22:32 
GeneralRe: Adding user-defined keywords Pin
Iain Clarke, Warrior Programmer28-Nov-02 22:52
Iain Clarke, Warrior Programmer28-Nov-02 22:52 
GeneralRe: Adding user-defined keywords Pin
RicoH29-Nov-02 0:58
RicoH29-Nov-02 0:58 
GeneralOwner draw controls and CDialogBars Pin
Mirko M.28-Nov-02 20:48
sussMirko M.28-Nov-02 20:48 
I have derived a class from CButton and I have
overridden OnPaint and OnDraw methods in order
to change the control appearance.
This class work without problems if the custom
control is placed in a CDialog window.
When I place my control in a CDialogBar window,
my class does't work: OnPaint is never called.
I have also used the Invalidate method for the
CDialogBar window and for the custom control but
the WM_PAINT message doesn't reach my control.

How can I solve this problem ??

I have also tried to call the OnPaint method of
the CDialogBar window through its parent window
and I have had another problem. The fllowing code
fails when I try to create a CPaintDC object:

void CGradHistogram::OnPaint()
{
CRect rectUpdate;
CBitmap* pOldBitmap;
CPaintDC dc(this); <<<<<<<---- FAILS HERE
CRect l_crctGraphic;

if(!m_boDcInitialized)
{
GetClientRect(&l_crctGraphic);

// Creates the memory device context and the bitmap
if(m_pdcMemory->GetSafeHdc() == NULL)
{
CClientDC ClientDc(this);

m_pdcMemory->CreateCompatibleDC(&ClientDc);
m_pBitmap->CreateCompatibleBitmap(&ClientDc, l_crctGraphic.Width(),
l_crctGraphic.Height());

m_pdcMemory->SetMapMode(MM_TEXT);
}
else
{
AfxMessageBox(_T("Cannot create DC!!!"), MB_OK | MB_ICONEXCLAMATION);
}

m_boDcInitialized = TRUE;
}

dc.GetClipBox(&rectUpdate);

pOldBitmap = m_pdcMemory->SelectObject(m_pBitmap);
m_pdcMemory->SelectClipRgn(NULL);
m_pdcMemory->IntersectClipRect(&rectUpdate);

OnDraw(m_pdcMemory);

dc.BitBlt(rectUpdate.left, rectUpdate.top,
rectUpdate.Width(), rectUpdate.Height(),
m_pdcMemory, rectUpdate.left, rectUpdate.top,
SRCCOPY);

m_pdcMemory->SelectObject(pOldBitmap);
}


Does someone can help me ???

Thanks a lot !!!!
Questionwhat's the equivalent of LoadIcon for text file? Pin
devvvy28-Nov-02 18:51
devvvy28-Nov-02 18:51 
AnswerRe: what's the equivalent of LoadIcon for text file? Pin
berndg28-Nov-02 19:53
berndg28-Nov-02 19:53 
GeneralRe: what's the equivalent of LoadIcon for text file? Pin
devvvy29-Nov-02 17:16
devvvy29-Nov-02 17:16 
QuestionWhere can I find guides on VSS? Pin
George228-Nov-02 18:50
George228-Nov-02 18:50 
AnswerRe: Where can I find guides on VSS? Pin
Ravi Bhavnani29-Nov-02 12:10
professionalRavi Bhavnani29-Nov-02 12:10 
GeneralRe: Where can I find guides on VSS? Pin
George229-Nov-02 18:36
George229-Nov-02 18:36 
GeneralRe: Where can I find guides on VSS? Pin
Ravi Bhavnani30-Nov-02 4:39
professionalRavi Bhavnani30-Nov-02 4:39 
GeneralRe: Where can I find guides on VSS? Pin
George230-Nov-02 16:28
George230-Nov-02 16:28 
GeneralWinsock gethostbyaddr problem Pin
Shamoon28-Nov-02 18:26
Shamoon28-Nov-02 18:26 
GeneralRe: Winsock gethostbyaddr problem Pin
Rickard Andersson2029-Nov-02 3:09
Rickard Andersson2029-Nov-02 3:09 
GeneralNeed help in removing element in std::map ! Pin
bahruddina28-Nov-02 15:20
bahruddina28-Nov-02 15:20 
GeneralRe: Need help in removing element in std::map ! Pin
Scott H. Settlemier28-Nov-02 16:27
Scott H. Settlemier28-Nov-02 16:27 
GeneralUnresolved symbol CLSID_SQLOLEDB Pin
paulb28-Nov-02 14:41
paulb28-Nov-02 14:41 
GeneralChanging a view in an SDI. Pin
VanHlebar28-Nov-02 14:32
VanHlebar28-Nov-02 14:32 
GeneralRe: Changing a view in an SDI. Pin
Anatari28-Nov-02 15:15
Anatari28-Nov-02 15:15 
GeneralRe: Changing a view in an SDI. Pin
VanHlebar29-Nov-02 7:40
VanHlebar29-Nov-02 7:40 
GeneralRe: Changing a view in an SDI. Pin
deffer1-Dec-02 17:50
deffer1-Dec-02 17:50 

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.