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 haddle OnAplly() for many property sheets [modified]

;how do you haddle OnAplly() for many property sheets [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++databasehelptutorial
3 Posts 3 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.
  • K Offline
    K Offline
    kingori
    wrote on last edited by
    #1

    hi since when Apply is clicked in a property sheet, its OnAplly() calls updateData() for the active page and initializes an ELLPROP structure with the settings, then sends a message to the main window containing the structures address.The main Window forwads the massage to the view (so far so good),the view copies the property values to its own data members (comes the problem) -suppopse i have many property sheets,each one will have an OnApply() that will fill the ELLPROP Structure with its own values, the mainframe will handle OnApply Once like this LRESULT CMainFrame::OnAplly(WPARAM wParam,LPARAM lParam) { m_wndView.SendMessage(WM_USER_APPLY,wParam,lParam); return 0; } then the view also will handle it once ..view::OnAplly(WPARAM wParam,LPARAM lParam) { ELLPROP* pep = (ELLPROP*)lParam; // my question what do i do here (if am supposed to do it only here) if i have multiple property sheets // :confused:lemmi give an example i may think of using proprty sheets insead of very many dialog boxes to write a simple school management program. so one property sheet be for registration (first page studets reg, 2nd page staff reg,3rd page, members reg ..), another property sheet will be for finance (1st page setting the fees charges,2nd page payment of fees, 3rd page payment os salaries and wages to workers, 4th page payment of bills ..) know i want each to update a database using ADO so each property page will have to open an appropriate recordset and do that(i havent tried the database part and know whether it will bring problems too),what i have tried is to have all the input values sent to the view so that i can display them in the client area and i dont know how the view's member variables will copy all these values that are coming from different property sheets and each sending an ELLPROP structure..(should i have some kind of control to know that this structure is from the finance sheet so just copy the finance deatils and leave the registration details- and if so how do i control that) ....... ..... } am new to MFC (4 mths know) so please if you can give me more deatils i'll rilly appreciate,thanks.:laugh: i h -- modified at 2:28 Monday 13th August, 2007

    P J 2 Replies Last reply
    0
    • K kingori

      hi since when Apply is clicked in a property sheet, its OnAplly() calls updateData() for the active page and initializes an ELLPROP structure with the settings, then sends a message to the main window containing the structures address.The main Window forwads the massage to the view (so far so good),the view copies the property values to its own data members (comes the problem) -suppopse i have many property sheets,each one will have an OnApply() that will fill the ELLPROP Structure with its own values, the mainframe will handle OnApply Once like this LRESULT CMainFrame::OnAplly(WPARAM wParam,LPARAM lParam) { m_wndView.SendMessage(WM_USER_APPLY,wParam,lParam); return 0; } then the view also will handle it once ..view::OnAplly(WPARAM wParam,LPARAM lParam) { ELLPROP* pep = (ELLPROP*)lParam; // my question what do i do here (if am supposed to do it only here) if i have multiple property sheets // :confused:lemmi give an example i may think of using proprty sheets insead of very many dialog boxes to write a simple school management program. so one property sheet be for registration (first page studets reg, 2nd page staff reg,3rd page, members reg ..), another property sheet will be for finance (1st page setting the fees charges,2nd page payment of fees, 3rd page payment os salaries and wages to workers, 4th page payment of bills ..) know i want each to update a database using ADO so each property page will have to open an appropriate recordset and do that(i havent tried the database part and know whether it will bring problems too),what i have tried is to have all the input values sent to the view so that i can display them in the client area and i dont know how the view's member variables will copy all these values that are coming from different property sheets and each sending an ELLPROP structure..(should i have some kind of control to know that this structure is from the finance sheet so just copy the finance deatils and leave the registration details- and if so how do i control that) ....... ..... } am new to MFC (4 mths know) so please if you can give me more deatils i'll rilly appreciate,thanks.:laugh: i h -- modified at 2:28 Monday 13th August, 2007

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      Can you reword the question, to others understanding ?


      Prasad MS MVP -  VC++

      1 Reply Last reply
      0
      • K kingori

        hi since when Apply is clicked in a property sheet, its OnAplly() calls updateData() for the active page and initializes an ELLPROP structure with the settings, then sends a message to the main window containing the structures address.The main Window forwads the massage to the view (so far so good),the view copies the property values to its own data members (comes the problem) -suppopse i have many property sheets,each one will have an OnApply() that will fill the ELLPROP Structure with its own values, the mainframe will handle OnApply Once like this LRESULT CMainFrame::OnAplly(WPARAM wParam,LPARAM lParam) { m_wndView.SendMessage(WM_USER_APPLY,wParam,lParam); return 0; } then the view also will handle it once ..view::OnAplly(WPARAM wParam,LPARAM lParam) { ELLPROP* pep = (ELLPROP*)lParam; // my question what do i do here (if am supposed to do it only here) if i have multiple property sheets // :confused:lemmi give an example i may think of using proprty sheets insead of very many dialog boxes to write a simple school management program. so one property sheet be for registration (first page studets reg, 2nd page staff reg,3rd page, members reg ..), another property sheet will be for finance (1st page setting the fees charges,2nd page payment of fees, 3rd page payment os salaries and wages to workers, 4th page payment of bills ..) know i want each to update a database using ADO so each property page will have to open an appropriate recordset and do that(i havent tried the database part and know whether it will bring problems too),what i have tried is to have all the input values sent to the view so that i can display them in the client area and i dont know how the view's member variables will copy all these values that are coming from different property sheets and each sending an ELLPROP structure..(should i have some kind of control to know that this structure is from the finance sheet so just copy the finance deatils and leave the registration details- and if so how do i control that) ....... ..... } am new to MFC (4 mths know) so please if you can give me more deatils i'll rilly appreciate,thanks.:laugh: i h -- modified at 2:28 Monday 13th August, 2007

        J Offline
        J Offline
        jhwurmbach
        wrote on last edited by
        #3

        king`ori wrote:

        each property page will have to open an appropriate recordset

        This is a flaw in your design: The document should hold the connection to the database, and the views (a property sheet is a view) access the property sheet. This holds true even if your application does not use MFC Doc/View. This paradigma is called model/view/controller and is independent of the toolkit used. You just might have to code more yourself.


        Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
        George Orwell, "Keep the Aspidistra Flying", Opening words

        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