CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    71

    Persisting Data in Classes Pls. Help

    Hi,
    I m creating an ActiveXDll.In that Dll I have one Class for which I have Persistent property = 1.

    Now I have got two properties in this class namely
    1) UserName.
    2) CompanyNo.

    Since i have created properties U can set these values.

    Now My Question is that suppose I create an object of this class and set the UserName to "ABC".

    Now when I create another object of this class I should be able to get the username Setted by another object.

    In Short Is there a way in ActiveX Dll's or Classes where I can Share a particular Information Accross various objects of class
    without using CONSTANTS because at some or other time i need to update this information
    and this updated information should be available accross all objects.

    Can U help?


  2. #2
    Join Date
    Mar 2002
    Location
    Izhevsk, Udmurtia, Russia
    Posts
    930

    Re: Persisting Data in Classes Pls. Help

    The mechanism of Persisting Data has not to your task of any relation. It is applied only to a concrete instance of a class and is necessary for restoration of the data of this instance after its closing and subsequent re-opening.

    Let's assume, that the client creates the your server's object, makes any changes in it and keeps on a disk. Then he can restore the saved data into your server's object. It is possible through this mechanism.

    In your case you can only use (for the existing object A and new object B):

    set B = new ClassX
    B.UserName = A.UserName




    Also, you can use the "static" member in Class module OR the global variable in Module. It may solve you problem.

    With best wishes,
    Vita
    With best wishes,
    Vita
    -----------------------
    Russian Software Development Network -- http://www.rsdn.ru

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