Click here to Skip to main content
15,887,585 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error running debugger from Visual studio 2010 Pin
Member 935023722-Apr-15 23:19
Member 935023722-Apr-15 23:19 
GeneralRe: Error running debugger from Visual studio 2010 Pin
Richard MacCutchan22-Apr-15 23:22
mveRichard MacCutchan22-Apr-15 23:22 
AnswerRe: Error running debugger from Visual studio 2010 Pin
Maximilien22-Apr-15 6:59
Maximilien22-Apr-15 6:59 
QuestionVSS restore in C++ Pin
Wshwilfried21-Apr-15 23:04
Wshwilfried21-Apr-15 23:04 
AnswerRe: VSS restore in C++ Pin
Richard MacCutchan22-Apr-15 0:56
mveRichard MacCutchan22-Apr-15 0:56 
Question[MFC] Using the SS_OWNERDRAW style on a CStatic control Pin
Maximilien21-Apr-15 9:50
Maximilien21-Apr-15 9:50 
AnswerRe: [MFC] Using the SS_OWNERDRAW style on a CStatic control Pin
Richard Andrew x6421-Apr-15 11:22
professionalRichard Andrew x6421-Apr-15 11:22 
GeneralRe: [MFC] Using the SS_OWNERDRAW style on a CStatic control Pin
Maximilien22-Apr-15 3:13
Maximilien22-Apr-15 3:13 
I tried modifying the resource manually but the resulting control is not a groupbox and the framework does not call my overridden DrawItem and the resulting control in the dialog is completely wrong.

This is my resource definition.
IDD_TESTDIALOG_DIALOG DIALOGEX 0, 0, 320, 200
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "testDialog"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
    GROUPBOX        "Static",IDC_CUSTOM_STATIC,57,7,48,40, SS_OWNERDRAW
END
void CColorGroupBox::PreSubclassWindow()
{
    // VERIFY( ModifyStyle(0, SS_OWNERDRAW) ); // this will fail if SS_OWNERDRAW is set in the resources;
    __super::PreSubclassWindow();
}

void CColorGroupBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct )
{
    CDC dc; 
    dc. Attach (lpDrawItemStruct->hDC); 
    CRect rect;
    GetClientRect(rect);
    rect.DeflateRect(10, 10, 10, 10);

    CBrush brush( RGB( 255, 0, 0));
    dc.FrameRect( rect , &brush );

    dc.Detach();
}

Am I missing something ?

Thanks Richard,

Max.
I'd rather be phishing!

AnswerRe: [MFC] Using the SS_OWNERDRAW style on a CStatic control Pin
Jochen Arndt21-Apr-15 21:24
professionalJochen Arndt21-Apr-15 21:24 
GeneralRe: [MFC] Using the SS_OWNERDRAW style on a CStatic control Pin
Maximilien22-Apr-15 3:00
Maximilien22-Apr-15 3:00 
GeneralRe: [MFC] Using the SS_OWNERDRAW style on a CStatic control Pin
Jochen Arndt22-Apr-15 3:41
professionalJochen Arndt22-Apr-15 3:41 
QuestionMultiple Client Support Server Application designed with Named Pipes hangs frequently Pin
SRIVATHSAN VIJAYA20-Apr-15 23:15
SRIVATHSAN VIJAYA20-Apr-15 23:15 
SuggestionRe: Multiple Client Support Server Application designed with Named Pipes hangs frequently Pin
Richard MacCutchan20-Apr-15 23:31
mveRichard MacCutchan20-Apr-15 23:31 
QuestionHow to implement usb touch driver in win ce 6.0 Pin
cedricvictor20-Apr-15 20:56
cedricvictor20-Apr-15 20:56 
SuggestionRe: How to implement usb touch driver in win ce 6.0 Pin
Richard MacCutchan20-Apr-15 21:22
mveRichard MacCutchan20-Apr-15 21:22 
QuestionExe file compatibility Pin
lor7517-Apr-15 8:57
lor7517-Apr-15 8:57 
AnswerRe: Exe file compatibility Pin
bling17-Apr-15 9:45
bling17-Apr-15 9:45 
AnswerRe: Exe file compatibility Pin
David Crow17-Apr-15 10:20
David Crow17-Apr-15 10:20 
AnswerRe: Exe file compatibility Pin
Frankie-C17-Apr-15 10:58
Frankie-C17-Apr-15 10:58 
AnswerRe: Exe file compatibility Pin
Albert Holguin1-May-15 4:56
professionalAlbert Holguin1-May-15 4:56 
QuestionUnable to invoke VIsual Studio debugger in Child process VS2012 pro Pin
ForNow17-Apr-15 3:01
ForNow17-Apr-15 3:01 
AnswerRe: Unable to debug Child process VS2012 pro follow up Pin
ForNow17-Apr-15 11:34
ForNow17-Apr-15 11:34 
GeneralI think I found a solution Pin
ForNow20-Apr-15 14:26
ForNow20-Apr-15 14:26 
QuestionRe: Unable to invoke VIsual Studio debugger in Child process VS2012 pro Pin
Richard MacCutchan17-Apr-15 21:17
mveRichard MacCutchan17-Apr-15 21:17 
AnswerRe: Unable to invoke VIsual Studio debugger in Child process VS2012 pro Pin
ForNow18-Apr-15 14:57
ForNow18-Apr-15 14:57 

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.