Click here to Skip to main content
15,889,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMonitoring application memory usage Pin
dushkin29-Sep-13 7:33
dushkin29-Sep-13 7:33 
SuggestionRe: Monitoring application memory usage Pin
David Crow29-Sep-13 16:40
David Crow29-Sep-13 16:40 
GeneralRe: Monitoring application memory usage Pin
dushkin29-Sep-13 20:12
dushkin29-Sep-13 20:12 
GeneralRe: Monitoring application memory usage Pin
David Crow30-Sep-13 3:06
David Crow30-Sep-13 3:06 
GeneralRe: Monitoring application memory usage Pin
jschell30-Sep-13 8:30
jschell30-Sep-13 8:30 
AnswerRe: Monitoring application memory usage Pin
ExcellentOrg29-Sep-13 23:48
ExcellentOrg29-Sep-13 23:48 
AnswerRe: Monitoring application memory usage Pin
Rolf Kristensen30-Sep-13 22:57
Rolf Kristensen30-Sep-13 22:57 
QuestionCSplitterWnd not showing Pin
Richard Andrew x6428-Sep-13 18:52
professionalRichard Andrew x6428-Sep-13 18:52 
I have a single document frame window with multiple views and I'm trying to add a view that contains a splitter window.

For this new view I have created a base CView that contains a CSplitterWnd. The splitter has one row, and two columns. The left column is a CTreeView derivative, and the right column is a CView derivative that contains a CMFCPropertyGridCtrl.

When the program switches to this new view, it is totally blank with no splitter bar or child views. What have I failed to do to get the splitter view to display correctly? Is it valid for a CSplitterWnd to be hosted inside a CView?

This is the code inside the base CView that creates the splitter:
C#
int CGSFeaturesView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CView::OnCreate(lpCreateStruct) == -1)
        return -1;

    Splitter.CreateStatic(this, 1, 2);

    CCreateContext Context;
    Context.m_pCurrentDoc = GetDocument();

    Splitter.CreateView(0, 0, RUNTIME_CLASS(CGSFeatureTreeView), CSize(0,0), &Context);
    Splitter.CreateView(0, 1, RUNTIME_CLASS(CGSFeaturePropertyView), CSize(0,0), &Context);
    Splitter.SetColumnInfo(0, 300, 200);
    Splitter.SetColumnInfo(1, 300, 200);
    Splitter.SetRowInfo(0, 1000, 200);

    return 0;
}


This is the code inside the CWinApp that switches views: (Taken from the MSDN example that shows how to create multiple views for a single document)
void CGSApp::SwitchToView(CView* pNewView)
{
    CView* pActiveView = ((CFrameWnd*) m_pMainWnd)->GetActiveView();


    // Exchange view window IDs so RecalcLayout() works.
    UINT temp = ::GetWindowLong(pActiveView->m_hWnd, GWL_ID);
    UINT temp1 = ::GetWindowLong(pNewView->m_hWnd, GWL_ID);
    ::SetWindowLong(pActiveView->m_hWnd, GWL_ID, temp1);
    ::SetWindowLong(pNewView->m_hWnd, GWL_ID, temp);

    pActiveView->ShowWindow(SW_HIDE);
    pNewView->ShowWindow(SW_SHOW);
    ((CFrameWnd*) m_pMainWnd)->SetActiveView(pNewView);
    ((CFrameWnd*) m_pMainWnd)->RecalcLayout();
    pNewView->Invalidate();
}

Thank you for reading my question.



The difficult we do right away...
...the impossible takes slightly longer.

SuggestionRe: CSplitterWnd not showing Pin
Richard MacCutchan28-Sep-13 21:24
mveRichard MacCutchan28-Sep-13 21:24 
AnswerRe: CSplitterWnd not showing Pin
«_Superman_»28-Sep-13 21:58
professional«_Superman_»28-Sep-13 21:58 
QuestionRe: CSplitterWnd not showing Pin
Richard Andrew x6429-Sep-13 5:10
professionalRichard Andrew x6429-Sep-13 5:10 
AnswerRe: CSplitterWnd not showing Pin
Richard MacCutchan29-Sep-13 7:13
mveRichard MacCutchan29-Sep-13 7:13 
AnswerRe: CSplitterWnd not showing Pin
Richard Andrew x6429-Sep-13 10:05
professionalRichard Andrew x6429-Sep-13 10:05 
GeneralRe: CSplitterWnd not showing Pin
Richard MacCutchan29-Sep-13 20:50
mveRichard MacCutchan29-Sep-13 20:50 
QuestionChanging default audio device Pin
Hrenzik28-Sep-13 15:35
Hrenzik28-Sep-13 15:35 
SuggestionRe: Changing default audio device Pin
David Crow28-Sep-13 17:25
David Crow28-Sep-13 17:25 
QuestionOutdated Driver List Pin
john563226-Sep-13 20:13
john563226-Sep-13 20:13 
QuestionRe: Outdated Driver List Pin
David Crow27-Sep-13 3:27
David Crow27-Sep-13 3:27 
QuestionGiving audio-input to a C program Pin
Member 1030065726-Sep-13 17:52
Member 1030065726-Sep-13 17:52 
AnswerRe: Giving audio-input to a C program Pin
Jonathan Davies27-Sep-13 4:13
Jonathan Davies27-Sep-13 4:13 
AnswerRe: Giving audio-input to a C program Pin
Vaclav_27-Sep-13 6:40
Vaclav_27-Sep-13 6:40 
QuestionCView advice Pin
Richard Andrew x6426-Sep-13 10:21
professionalRichard Andrew x6426-Sep-13 10:21 
AnswerRe: CView advice Pin
«_Superman_»26-Sep-13 19:56
professional«_Superman_»26-Sep-13 19:56 
GeneralRe: CView advice Pin
Richard Andrew x6427-Sep-13 10:25
professionalRichard Andrew x6427-Sep-13 10:25 
AnswerRe: CView advice Pin
Richard MacCutchan26-Sep-13 21:34
mveRichard MacCutchan26-Sep-13 21:34 

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.