Creating INI Files

Creating INI Files

Question:
How do I create INI files to meet the common microsoft standard?

Answer:
INI files can be created with Notepad, or any other plain text editor. Once the file is created, or even if it is not, you can use GetPrivateProfileString and WritePrivateProfileString to write settings to the file. If, for instance, you want to do a write to a non-existent INI file, Windows will create the file for you when you do your first write to it with WritePrivateProfileString.Your best bet for structuring is to look at existing INI files on your drive, especially ones written by Microsoft programs.Please note that the use of private INI files is becoming less and less common with VB4 32-bit and the 32-bit OS’s (Windows ’95 and NT 4.0). The proper thing to do there is to write to the registry. VB 4 provides four functions to access the registry without much trouble. Note that these functions are somewhat limited, the best way to go about it is with the API calls provided. You can find out more about the four built-in functions from the March issue of VBOnline magazine (and other resources).

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist