Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Urgent help needed

Urgent help needed

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brian V Shifrin
    wrote on last edited by
    #1

    I am trying to embed view inside custom tab

    More like DiLascia tab.....

    http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0599/c++/c++0599.htm&nav=/msj/0599/newnav.htm

    So far

    SDIFrame
    CMyView
    CList
    CStatic
    ....
    CFolderTab
    CView1
    CEditN
    CView2
    .....

    Create CView1/CView2

    CRect rectDummy(0, 0, 0, 0);
    CreateContext cc;
    ZeroMemory(&cc, sizeof(cc));
    m_pView1 = (CView1 *)RUNTIME_CLASS(CView1)->CreateObject();
    if (!m_pView1 ||
    !((CWnd *)m_pView1 )->Create(NULL, NULL, WS_CHILD,
    rectDummy, m_pFlatTabCtrl, IDC_CONNECTION_G_PROPERTIES, &cc))
    {
    TRACE0( "Failed to create View1.\n" );
    return -1;
    }
    folderTab.AddPage(0,m_pView1);

    View looks fine and DDX*, DDV work in View1,

    But when focus set to CEditN within CView1 no messages routed to CMyView.

    What am I missing?

    W 1 Reply Last reply
    0
    • B Brian V Shifrin

      I am trying to embed view inside custom tab

      More like DiLascia tab.....

      http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0599/c++/c++0599.htm&nav=/msj/0599/newnav.htm

      So far

      SDIFrame
      CMyView
      CList
      CStatic
      ....
      CFolderTab
      CView1
      CEditN
      CView2
      .....

      Create CView1/CView2

      CRect rectDummy(0, 0, 0, 0);
      CreateContext cc;
      ZeroMemory(&cc, sizeof(cc));
      m_pView1 = (CView1 *)RUNTIME_CLASS(CView1)->CreateObject();
      if (!m_pView1 ||
      !((CWnd *)m_pView1 )->Create(NULL, NULL, WS_CHILD,
      rectDummy, m_pFlatTabCtrl, IDC_CONNECTION_G_PROPERTIES, &cc))
      {
      TRACE0( "Failed to create View1.\n" );
      return -1;
      }
      folderTab.AddPage(0,m_pView1);

      View looks fine and DDX*, DDV work in View1,

      But when focus set to CEditN within CView1 no messages routed to CMyView.

      What am I missing?

      W Offline
      W Offline
      wangyiming
      wrote on last edited by
      #2

      BOOL CMyView::PreTranslateMessage(MSG* pMsg) { if( pMsg->message == WM_SETFOCUS && pMsg->hwnd == m_edit.GetSafeHwnd() ) // CEditN: m_edit { // add your codes } return CView::PreTranslateMessage(pMsg); }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups