Click here to Skip to main content
15,908,437 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMapViewOfFIle in Client and Server returning 2 different address Pin
ForNow24-Apr-15 11:40
ForNow24-Apr-15 11:40 
AnswerRe: MapViewOfFIle in Client and Server returning 2 different address Pin
Richard Andrew x6424-Apr-15 12:06
professionalRichard Andrew x6424-Apr-15 12:06 
GeneralRe: MapViewOfFIle in Client and Server returning 2 different address Pin
ForNow24-Apr-15 12:31
ForNow24-Apr-15 12:31 
AnswerRe: MapViewOfFIle in Client and Server returning 2 different address Pin
Frankie-C25-Apr-15 7:37
Frankie-C25-Apr-15 7:37 
GeneralRe: MapViewOfFIle in Client and Server returning 2 different address Pin
ForNow25-Apr-15 15:09
ForNow25-Apr-15 15:09 
QuestionInterProcess communication questions Pin
ForNow24-Apr-15 8:44
ForNow24-Apr-15 8:44 
AnswerRe: InterProcess communication questions Pin
Frankie-C25-Apr-15 7:35
Frankie-C25-Apr-15 7:35 
GeneralRe: InterProcess communication questions Pin
ForNow25-Apr-15 15:08
ForNow25-Apr-15 15:08 
QuestionSynchronizing access to data Pin
ramonlarodo22-Apr-15 21:55
ramonlarodo22-Apr-15 21:55 
QuestionRe: Synchronizing access to data Pin
Richard MacCutchan22-Apr-15 23:25
mveRichard MacCutchan22-Apr-15 23:25 
QuestionCDateTimeCtrl editing short year format Pin
baerten22-Apr-15 21:51
baerten22-Apr-15 21:51 
QuestionRe: CDateTimeCtrl editing short year format Pin
Richard MacCutchan22-Apr-15 23:23
mveRichard MacCutchan22-Apr-15 23:23 
AnswerRe: CDateTimeCtrl editing short year format Pin
baerten24-Apr-15 0:06
baerten24-Apr-15 0:06 
SuggestionRe: CDateTimeCtrl editing short year format Pin
Richard MacCutchan24-Apr-15 0:24
mveRichard MacCutchan24-Apr-15 0:24 
GeneralRe: CDateTimeCtrl editing short year format Pin
baerten24-Apr-15 0:31
baerten24-Apr-15 0:31 
QuestionError running debugger from Visual studio 2010 Pin
Member 935023722-Apr-15 4:28
Member 935023722-Apr-15 4:28 
AnswerRe: Error running debugger from Visual studio 2010 Pin
Richard MacCutchan22-Apr-15 6:30
mveRichard MacCutchan22-Apr-15 6:30 
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!

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.