When to Use WIN.INI or a Private INI FileLast reviewed: July 22, 1997Article ID: Q74608 |
3.00 3.10
WINDOWS
kbprg
The information in this article applies to:
SUMMARYAn application should use a private profile (INI) file to store initialization information where possible rather than the main INI file in Windows, WIN.INI. Profile files are not designed for use as a database or a mass-storage device.
MORE INFORMATIONApplications use the profile functions in the Windows application programming interface (API) to save and retrieve initialization settings. The following profile functions are used with WIN.INI:
GetProfileInt GetProfileString WriteProfileStringUntil Windows version 3.0, applications stored their initialization data in only one global place (WIN.INI). Windows version 3.0 added a complimentary set of functions to the Windows API to enable an application to store its initialization data in a private INI file. These functions are as follows:
GetPrivateProfileInt GetPrivateProfileString WritePrivateProfileStringThe following factors provided the motivation for the addition of private INI files:
Do not use the private profile functions with the WIN.INI file. Windows caches a copy of WIN.INI and one private INI file. This caching scheme may be confused if WIN.INI is altered using the private profile functions. Applications should use INI files conservatively. Use as few sections and as few lines as possible. For example, do not save the coordinates of a window individually, as follows:
[window save pos] ul = 10 ur = 10 ll = 100 lr = 100Instead, use one line, as follows:
[save_pos] window=10 10 100 100This is a more efficient use of space and is much faster.
|
Additional reference words: 3.00 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |