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. How do you call a default view in MDI application?

How do you call a default view in MDI application?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++databaseperformancequestion
1 Posts 1 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.
  • J Offline
    J Offline
    Jasmyn
    wrote on last edited by
    #1

    I have created a simple MDI application with the MFC class wizard. At the moment I have only one view and one document. The view has CListView as a base class. I have disabled the new file option on startup by using cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing; The user can either call a add menu option that displays a dialog box with which they can add data to the database, or they can pick a view menu option which will allow them to view all the data added on that particular day. My problem is calling the view from the mainframe menu option. I have read several articles but they all deal with adding documents and views and then swopping between them. I know I'm probably being very dense but have tried the whole of yesterday with no success.:-O . This is the code I'm using to initialize the List view in myView::OnInitialUpdate. DWORD dwExStyle; CRepPartDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); //CActionsApp *pApp = (CActionsApp*)AfxGetApp(); CListCtrl& m_List = GetListCtrl(); dwExStyle = m_List.GetExStyle(); dwExStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES; m_List.SetExtendedStyle(dwExStyle); m_List.SetBkColor(RGB(255, 255, 255)); ASSERT(m_List.GetBkColor() == RGB(255, 255, 255)); m_List.InsertColumn(0,_T("Share"),LVCFMT_LEFT,160); m_List.InsertColumn(1,_T("Status"),LVCFMT_LEFT,90); m_List.InsertColumn(2,_T("Action Date"),LVCFMT_LEFT,90); m_List.InsertColumn(3,_T("Book Date"),LVCFMT_LEFT,90); m_List.InsertColumn(4,_T("Comment"),LVCFMT_LEFT,160); Someone has suggested calling OnFileNew() from my menu handler but no success. Please help! Any suggestions will be more than I have already! Grasp it but you cannot get it! It's name is memory..

    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