Thread: dao demo with embedded property sheet

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    dao demo with embedded property sheet

    usually you would have to map the m_Name variable to the dialog and call UpdateData( FALSE )

    ...

    m_pSheet->SetActivePage( [something other than the index for page 1] );
    m_page1.m_strName = "John Doe";
    m_pSheet->SetActivePage( page1Index ); //** this will call
    update data false...

    or

    m_pSheet->SetActivePage( page1Index );
    m_page1.m_strName = "John Doe";
    m_page1.UpdateData( FALSE ); //call true to retrieve the value

    the problem with this is is that the call will give you all kinds of errors in m_page1 is not currently the active page....

    the index of the pages depends on the order in which they were added 0 - n....

    so in order to update the second page for instance...

    m_pSheet->SetActivePage( 1 );
    m_page1.m_name = "John Doe";
    m_page1.UpdateData( FALSE );

    ....if your variables are not mapped...
    you can do this...
    m_pSheet->SetActivePage( 0 );
    m_page1.SetDlgItemText( IDC_EDIT_NAME, m_page1.m_strName );

    and to retrieve it
    m_page1.GetDlgItemText( IDC_EDIT_NAME, m_page1.m_strName);

    m_page2


    ...

    you can download a demo from my website.... it is related and might help you out....

    www.vvm.com/~fzamora/DaoDemo.zip

    .....
    zMan

  2. #2
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Cant thank you enough zMan, I've almost got the programming side of the database done now after all the help you've given me . One last quick question, I've rebuilt my app using DAO instead of ODBC, and I've noticed I can now add OLE Property Sheets. What are these and will they help?

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    COlePropertySheets

    hmm? I have never worked with them....
    Can you refer the object type by name. The only reference I could find to these was COlePropertyPage which is used to display the properties of an active x control...
    zMan

  4. #4
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    All I know about the ole property pages is that they can be added as a dialog resource in the insert resource dialog, and that their default idd is IDD_OLE_PROPPAGE_LARGE / SMALL. I dont think they are available in VC++ Standard, I'm using enterprise.

    Also I have another question . I want to be able to put a property sheet inside the property sheet on my form. This is how it works:
    I have my form (CTykeView), on which I have a property sheet with 8 pages, I'm calling these L1 (level 1) pages. Each one of those represents a main catagory. Under these pages I have more property pages (L2 pages) representing sub catagories.

    I have created a member function of one of my L1 pages called CreateL2Tabs();, which adds my L2 pages, very similar to the CreateTabControl(); function you gave me. My question is when and where do I call this function. I have tried calling it immediately after adding the L1 page

    pSheet->AddPage( &m_L1_1BookingIn );
    m_L1_1BookingIn.CreateL2Tabs();
    pSheet->AddPage( &m_L1_2Customers );

    But I get four assert errors, even though I am dealing with the active page (the first page).

    Thanks in advance

  5. #5
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121
    Sorry, didnt think about using OnSetActive() and OnKillActive() functions. Got it sorted now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a modeless property sheet
    By axr0284 in forum Windows Programming
    Replies: 6
    Last Post: 01-12-2005, 06:29 AM
  2. Moving a Property Sheet
    By Eibro in forum Windows Programming
    Replies: 1
    Last Post: 07-05-2003, 09:20 AM
  3. Dialog Box & Property Sheet :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-01-2002, 01:33 PM
  4. Passing a recordset pointer to a property sheet
    By Robert602 in forum Windows Programming
    Replies: 0
    Last Post: 05-14-2002, 07:45 AM
  5. Property Sheets :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 05-09-2002, 03:04 PM