Microsoft KB Archive/187299

= SAMPLE: PERSIST.EXE Persists Class Objects with VB6 =

Article ID: 187299

Article Last Modified on 3/3/2005

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q187299



SUMMARY
Persist.exe is a self-extracting compressed file that demonstrates how to persist objects in Microsoft Visual Basic 6.0. For the purpose of this article, if you can answer "yes" to the following question, then you have object persistence:

Can I save this object for later use?

When an object is created in Visual Basic (by instantiating a Visual Basic class), that object exists in memory and is destroyed when the application that created it is closed. This article demonstrates how to write the property values of an object to a file, in other words, "persist" the object. The object can later be recreated from the disk file, even if the computer has been shut down and restarted. Visual Basic version 6.0 introduces the capability for persisting objects in this manner.



MORE INFORMATION
The following files are available for download from the Microsoft Download Center:

Persist.exe

Release Date: Aug-31-1998

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

When you run the self-extracting file, the following files are expanded:

  PersistClient.exe       : Compiled Client Application Projects.dll           : Compiled ActiveX Component PersistClient.vbp      : Source Project for Client Application Form1.frm              : Client Project Form Projects.vbp           : Source Project for ActiveX Component ApprovedProject.cls    : ActiveX Component Class Readme.txt             : Information

Running the Sample Application

 * 1) Register Projects.dll using RegSvr32.exe. For example:

Regsvr32 c:\mydirectory\Projects.dll
 * 1) Run PersistClient.exe.
 * 2) Modify the data on the form, and click Save Object.
 * 3) You can now load, modify, and save the object.

Additional query words: persistable

Keywords: kbhowto kbdownload kbfile kbpersistst kbsample KB187299

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.