Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: sunnysky

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I also figured out how m_pDocument in each view is set.

    When creating views in CMainFrame::OnCreateClient(), CView::OnCreate() is called for each view to be created. In CView::OnCreate(), the...
  2. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I feel very grateful.
  3. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I finally figured out what the problem is.

    The problem is the CTabView as Victor pointed out in post #9.

    My CSecondView class inherits CTabView. So I need to override OnInitialUpdate() like:
    ...
  4. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    That's what I want to find out. Why does it exist this time?


    Besides, how does m_pDocument get set in the two views that the wizard creates? I debugged in to the CSingleDocTemplate constructor...
  5. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    When a "Windows Explorer" application is created, the SetActiveView() function is successfully called in CFrameWnd::InitialUpdateFrame(). While I create splitter windows, SetActiveView() in...
  6. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    So I was right in post 27, wasn't I?
  7. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    Then I created a "Windows Explorer" style application. The wizard created OnCreateClient() in CMainFrame. But CFrameWnd::OnCreateClient() is not called this time. However,...
  8. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I used "MFC Standard" to create a brand new project. I didn't add any splitter views. Then I override OnCreateClient() in CMainFrame like this.



    BOOL CMainFrame::OnCreateClient(...
  9. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I got this book. But it may not cover point 2 in your post 20.
  10. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I think since I override OnCreateClient() in CMainFrame, I need to explicitly call CFrameWnd::OnCreateClient(lpcs, pContext) at the beginning of CMainFrame::OnCreateClient().
  11. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    "CWnd* pWnd = GetDescendantWindow(AFX_IDW_PANE_FIRST, TRUE);" in CFrameWnd::InitialUpdateFrame() returns NULL in the project built from "MFC Standard" style even though "bMakeVisible" is TRUE.
  12. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I am learning MFC while getting familiar with our existing project. Unfortunately our existing project is using this ad-hoc approach.

    Do you know any book teaching the approaches you mentioned?
    ...
  13. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I found CFrameWnd::InitialUpdateFrame is called indirectly from "if (!ProcessShellCommand(cmdInfo))" statement in the CAlohaApp::InitInstance() function. But it wasn't called in an application built...
  14. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    The generated "Windows Explorer" style code doesn't do SetActiveView() in CMainFrame::OnCreateClient() after creating the split views. Strange.
  15. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    Got it. I was just expecting some more standard learning approach.
  16. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    That happens when I do things from scratch. I got NULL CDocument pointer when using GetActiveDocument(). This is shown in the attached program in the same projects.
  17. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    But that will sacrifice flexibility. The Wizard only provide CListView and CTreeView.
  18. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    For instance, the examples I saw don't call "CFrameWnd::OnCreateClient(lpcs, pContext)" in "CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )", but I found that if I don't...
  19. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    Thanks Victor.

    I created these view classes with the help of wizard and didn't add any code. My problem is that other than application specific members, I don't know which methods should be...
  20. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    Hello Victor,

    Here it is.

    Thanks,
    Brian
  21. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    Thanks Victor. But I think it is not enough. I added "SetActiveView((CView*)m_wndSplitter.GetPane(0, 0));" before "return TRUE;" and it still doesn't work.

    I stepped into...
  22. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    It's a message handler.

    BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
    ON_WM_CREATE()
    ON_COMMAND(ID_FILE_OPEN, &CMainFrame::OnFileOpen)
    ON_COMMAND(ID_ALOHA_HOWAREYOU,...
  23. Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    Hello,

    I created two split views like this:

    BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs, CCreateContext* pContext )
    {
    CFrameWnd::OnCreateClient(lpcs, pContext);

    if...
  24. Replies
    3
    Views
    163

    Re: Overridden CWinApp::OnFileOpen() handler

    Thanks. These information are very helpful.
  25. Replies
    3
    Views
    163

    Overridden CWinApp::OnFileOpen() handler

    Hello,

    I am working on an existing project and noticed some interesting phenomenon. I then created a small project and reproduced this behavior.

    When I created a new project, the system...
Results 1 to 25 of 27
Page 1 of 2 1 2


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center