Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Extending the C using preprocessor and other goodies - how do they interact? Pin
Vaclav_1-May-13 9:03
Vaclav_1-May-13 9:03 
GeneralRe: Extending the C using preprocessor and other goodies - how do they interact? Pin
jschell2-May-13 8:03
jschell2-May-13 8:03 
GeneralRe: Extending the C using preprocessor and other goodies - how do they interact? Pin
Stefan_Lang1-May-13 21:54
Stefan_Lang1-May-13 21:54 
GeneralRe: Extending the C using preprocessor and other goodies - how do they interact? Pin
Vaclav_4-May-13 5:34
Vaclav_4-May-13 5:34 
GeneralRe: Extending the C using preprocessor and other goodies - how do they interact? Pin
Stefan_Lang5-May-13 23:39
Stefan_Lang5-May-13 23:39 
QuestionOwner Draw MenuItem Displaying large in Size in Debug but in release it is Ok Pin
002comp30-Apr-13 21:14
002comp30-Apr-13 21:14 
AnswerRe: Owner Draw MenuItem Displaying large in Size in Debug but in release it is Ok Pin
Richard MacCutchan30-Apr-13 21:34
mveRichard MacCutchan30-Apr-13 21:34 
GeneralRe: Owner Draw MenuItem Displaying large in Size in Debug but in release it is Ok Pin
002comp1-May-13 0:25
002comp1-May-13 0:25 
hello Sir
I know that I didn't Post any Code and asking for Ideas. am Sorry for that.
But I found tht in Fn Onmeasureitem ,we are using drawText to get height of Text which is returning wrong [>1] in debug build and 1 in rlease build.

C++
CWindowDC dc(NULL);  // screen DC--I won't actually draw on it
         CRect rcText(0,0,0,0);
         CFont* pOldFont = dc.SelectObject(GetMenuFont());
         dc.DrawText(pmd->text, rcText, DT_MYSTANDARD|DT_CALCRECT);
         CSize size = dc.GetTextExtent(pmd->text);
         dc.SelectObject(pOldFont);

         // height of item is just height of a standard menu item
         lpms->itemHeight= max(GetSystemMetrics(SM_CYMENU), rcText.Height()+1);

         // width is width of text plus a bunch of stuff
         int cx = rcText.Width();   // text width
         cx += CXTEXTMARGIN<<1;     // L/R margin for readability
         cx += CXGAP;               // space between button and menu text
         cx += m_szButton.cx<<1;    // button width (L=button; R=empty margin)

         // whatever value I return in lpms->itemWidth, Windows will add the
         // width of a menu checkmark, so I must subtract to defeat Windows. Argh.
         //
         cx -= GetSystemMetrics(SM_CXMENUCHECK)-1;
         lpms->itemWidth = cx;      // done deal


Now, Any Ideas. m compiling it on VS 2010.

Regards
Y
SuggestionRe: Owner Draw MenuItem Displaying large in Size in Debug but in release it is Ok Pin
Richard MacCutchan1-May-13 1:49
mveRichard MacCutchan1-May-13 1:49 
QuestionDetect specific finger tip in convexhull Pin
Dilan Shaminda30-Apr-13 19:34
professionalDilan Shaminda30-Apr-13 19:34 
SuggestionRe: Detect specific finger tip in convexhull Pin
Vaclav_1-May-13 5:46
Vaclav_1-May-13 5:46 
GeneralRe: Detect specific finger tip in convexhull Pin
Dilan Shaminda1-May-13 20:16
professionalDilan Shaminda1-May-13 20:16 
GeneralRe: Detect specific finger tip in convexhull Pin
Dilan Shaminda1-May-13 20:16
professionalDilan Shaminda1-May-13 20:16 
QuestionThe "hide_gui" key in the regedit , i want to know how does it works? Pin
ITboy_Lemon30-Apr-13 16:42
professionalITboy_Lemon30-Apr-13 16:42 
AnswerRe: The "hide_gui" key in the regedit , i want to know how does it works? Pin
Richard MacCutchan30-Apr-13 21:31
mveRichard MacCutchan30-Apr-13 21:31 
QuestionAccess structure variable value using string representing variable's name in C++. Pin
shanmugarajaa30-Apr-13 1:43
shanmugarajaa30-Apr-13 1:43 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Sivaraman Dhamodharan30-Apr-13 2:10
Sivaraman Dhamodharan30-Apr-13 2:10 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Chris Losinger30-Apr-13 4:07
professionalChris Losinger30-Apr-13 4:07 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Newbie0030-Apr-13 7:43
Newbie0030-Apr-13 7:43 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
jschell30-Apr-13 9:47
jschell30-Apr-13 9:47 
AnswerRe: Access structure variable value using string representing variable's name in C++. Pin
Stefan_Lang1-May-13 22:09
Stefan_Lang1-May-13 22:09 
QuestionCatch OnKeyDown in CDialog Pin
_Flaviu29-Apr-13 23:52
_Flaviu29-Apr-13 23:52 
AnswerRe: Catch OnKeyDown in CDialog Pin
Chris Losinger30-Apr-13 1:52
professionalChris Losinger30-Apr-13 1:52 
GeneralRe: Catch OnKeyDown in CDialog Pin
_Flaviu30-Apr-13 2:11
_Flaviu30-Apr-13 2:11 
QuestionReadfile to read parent process console buffer Pin
ForNow29-Apr-13 15:51
ForNow29-Apr-13 15:51 

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.