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

C / C++ / MFC

 
AnswerRe: memory device context coordinates Pin
mo14926-Feb-19 13:30
mo14926-Feb-19 13:30 
GeneralRe: memory device context coordinates Pin
Alexander Kindel6-Feb-19 13:44
Alexander Kindel6-Feb-19 13:44 
AnswerRe: memory device context coordinates Pin
leon de boer6-Feb-19 15:55
leon de boer6-Feb-19 15:55 
GeneralRe: memory device context coordinates Pin
Alexander Kindel7-Feb-19 23:23
Alexander Kindel7-Feb-19 23:23 
GeneralRe: memory device context coordinates Pin
leon de boer8-Feb-19 21:43
leon de boer8-Feb-19 21:43 
AnswerRe: memory device context coordinates Pin
Alexander Kindel8-Feb-19 9:22
Alexander Kindel8-Feb-19 9:22 
QuestionMenu bar on title bar of application Pin
jung-kreidler6-Feb-19 2:23
jung-kreidler6-Feb-19 2:23 
QuestionChanged CMDIChildWnd to CMDIChildWndEx: does not show anything inside the frame Pin
Dansveen4-Feb-19 2:02
Dansveen4-Feb-19 2:02 
Hi all

I have an MFC application that works perfectly with the CMDIChildWnd class, the frame is loaded and a splitterwnd is shown. I needed to create a new MFC application that uses the ribbon as the interface, and for that the only change I made was that my classes inherited from CMDIChildWndEx.
The two MFC applications should work with CMDIChildWndEx, but the old application does not show anything in the frames, it does not show errors, exceptions, it does not show inside the window. I already tried changing the style, forcing the frame size, changing the spliterwnd but nothing worked. See the LoadFrame code:
<pre lang="c++">void CMyFrame::ActivateFrame(int nCmdShow)
{
if (m_pMDIFrame && m_pMDIFrame->SendMessage(WM_IS_ENABLE_MDI_TAB))
{
LONG style = ::GetWindowLong(GetSafeHwnd(), GWL_STYLE) | WS_MAXIMIZE;
style &= ~WS_BORDER & ~WS_THICKFRAME & ~WS_DLGFRAME & ~WS_CAPTION;
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, style);
style = ::GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);
style &= ~WS_EX_CLIENTEDGE;
::SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, style);
ShowWindow(SW_SHOWMAXIMIZED);
return;
}

if (m_bInsideMDIFrame)
{
CMDIChildWndEx::ActivateFrame(nCmdShow);
return;
}

long style = ::GetWindowLong(GetSafeHwnd(), GWL_STYLE);
style &= ~WS_MINIMIZEBOX & ~WS_MAXIMIZEBOX;
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, style);
style = ::GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);
style &= ~WS_EX_CLIENTEDGE;
::SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, style);

SetWindowPos(NULL, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE);

CFrameWnd::ActivateFrame(SW_SHOWNOACTIVATE);
}

BOOL CMyFrame::LoadFrame(UINT nIDResource, DWORD dwDefaultStyle,
CWnd* pParentWnd, CCreateContext* pContext)
{
if (g_globalVariables.GetParentWnd() == NULL)
{
if (m_bInsideMDIFrame)
return CMDIChildWndEx::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext);

return CFrameWnd::LoadFrame(nIDResource, dwDefaultStyle, pParentWnd, pContext);
}

ASSERT(m_nIDHelp == 0 || m_nIDHelp == nIDResource);

m_bInsideMDIFrame = FALSE;

m_nIDHelp = nIDResource; // ID for help context (+HID_BASE_RESOURCE)

CString strFullString;
if (strFullString.LoadString(nIDResource))
AfxExtractSubString(m_strTitle, strFullString, 0); // first sub-string

VERIFY(AfxDeferRegisterClass(AFX_WNDFRAMEORVIEW_REG));

dwDefaultStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;

// attempt to create the window
LPCTSTR lpszClass = GetIconWndClass(dwDefaultStyle, nIDResource);
LPCTSTR lpszTitle = m_strTitle;

if (!CFrameWnd::Create(lpszClass, lpszTitle, dwDefaultStyle, rectDefault, g_globalVariables.GetParentWnd(), 0, 0, pContext))
return FALSE; // will self destruct on failure normally

// save the default menu handle
ASSERT(m_hWnd != NULL);

m_hMenuDefault = ::GetMenu(m_hWnd);

// load accelerator resource
LoadAccelTable(MAKEINTRESOURCE(nIDResource));

if (pContext == NULL) // send initial update
SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);

return TRUE;
}</pre>

Another difference is if application uses MDI tabs, in my tests everything indicates that CMDIChildWndEx does not work without the ribbon.
Has anyone had the same problem? Please, can anyone help me?
Thank you very much
Question_findfirst and fopen very slow Pin
cristiapi31-Jan-19 1:13
cristiapi31-Jan-19 1:13 
QuestionRe: _findfirst and fopen very slow Pin
David Crow31-Jan-19 3:50
David Crow31-Jan-19 3:50 
AnswerRe: _findfirst and fopen very slow Pin
cristiapi31-Jan-19 3:58
cristiapi31-Jan-19 3:58 
QuestionRe: _findfirst and fopen very slow Pin
David Crow31-Jan-19 4:23
David Crow31-Jan-19 4:23 
AnswerRe: _findfirst and fopen very slow Pin
cristiapi31-Jan-19 5:34
cristiapi31-Jan-19 5:34 
QuestionRe: _findfirst and fopen very slow Pin
David Crow31-Jan-19 6:01
David Crow31-Jan-19 6:01 
AnswerRe: _findfirst and fopen very slow Pin
cristiapi31-Jan-19 6:07
cristiapi31-Jan-19 6:07 
GeneralRe: _findfirst and fopen very slow Pin
David Crow31-Jan-19 6:14
David Crow31-Jan-19 6:14 
QuestionRe: _findfirst and fopen very slow Pin
jeron131-Jan-19 4:58
jeron131-Jan-19 4:58 
AnswerRe: _findfirst and fopen very slow Pin
cristiapi31-Jan-19 5:20
cristiapi31-Jan-19 5:20 
QuestionRe: _findfirst and fopen very slow Pin
David Crow31-Jan-19 6:04
David Crow31-Jan-19 6:04 
AnswerRe: _findfirst and fopen very slow Pin
cristiapi31-Jan-19 6:10
cristiapi31-Jan-19 6:10 
GeneralRe: _findfirst and fopen very slow Pin
jeron131-Jan-19 8:28
jeron131-Jan-19 8:28 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 5:57
cristiapi1-Feb-19 5:57 
AnswerRe: _findfirst and fopen very slow Pin
Randor 31-Jan-19 14:23
professional Randor 31-Jan-19 14:23 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 0:29
cristiapi1-Feb-19 0:29 
AnswerRe: _findfirst and fopen very slow Pin
leon de boer31-Jan-19 14:54
leon de boer31-Jan-19 14:54 

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.