CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: CFormView

  1. #1
    Join Date
    Apr 1999
    Posts
    72

    CFormView

    I have a program that uses CFormView. On that dialog I have 6 Editboxs and 1 listbox, When you save the file and close it, then try to open it back you loose all the data you entered into the boxes. How can I save all the data that the user enters into those boxes? Any Ideas??

    Thanks!
    Nathan Strandberg


  2. #2
    Join Date
    Apr 1999
    Posts
    15

    Re: CFormView

    First of all, you need to perform DDX/DDV--send all the values in the editboxes and listbox to member variables. Then, modify Serialize so that those member variables are stored and loaded properly.


  3. #3
    Join Date
    Apr 1999
    Posts
    72

    Re: CFormView

    How?


  4. #4
    Join Date
    Apr 1999
    Posts
    15

    Re: CFormView

    Open ClassWizard, open the Member variables tab, click on each control ID and click Add Variable. Fill out the neccessary info. This will implement DDX/DDV. Now in your Serialize function (in the CDocument-derived class), serialize these variables. Look up how serialize works in the online documentation. Before putting the variables into or pulling them out of the CArchive object, call UpdateData(TRUE) or UpdateData(FALSE), respectively. If any of these terms are unfamiliar, look them up in the online documentation.


  5. #5
    Join Date
    Apr 1999
    Posts
    72

    Re: CFormView

    Thanks!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured