Re: parsing INI files...

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Carl Daniel [VC++ MVP] (cpdaniel_remove_this_and_nospam_at_mvps.org.nospam)
Date: 05/25/04


Date: Tue, 25 May 2004 13:12:59 -0700

Need Helps wrote:
> I'm creating a Win32 application, and I want to have some parameters
> defined in an INI file that is read in by the application. Being new
> to programming with Win32, I don't know how to parse INI files. I
> know how to do simple input/output from a text file, but is there a
> set of APIs specifically for reading parameters from an INI file? If
> so, where can I find the documentation for them? (I'm having no luck
> so far finding useful information on msdn.com) Thanks in advance!

Most new apps don't use INI files, rather they use XML or something in the
registry.

That said, if you want to read an INI file, look up GetPrivateProfileInt,
GetPrivateProfileString (etc) in MSDN.

-cd



Relevant Pages

  • WPP extended format specification strings
    ... In fact, several other types mentioned on the MSDN page is not supported, e.g. "%!time!", and according to the INI file several more types are supported that are not listed on MSDN. ... DEFINE_CPLX_TYPE(WSTR, WPP_LOGASTR, const char *, ItemString, "s", S, 0); ...
    (microsoft.public.development.device.drivers)
  • Re: GetPrivateProfileInt returns default value.
    ... even my ini file and key value are exists. ... When I put a messagebox to display the return value of ... I got GetPrivateProfileInt returns the nDefault. ... As Jim Mack said, this is a VB6 or lower group, however, you are using a mix ...
    (microsoft.public.vb.winapi)
  • Re: GetPrivateProfileInt returns default value
    ... Note that you should NEVER presume that the C:\ drive is writable; in most modern systems, ... If you want to store something in a .INI file, you should put it in the AppData ... I got GetPrivateProfileInt returns the nDefault. ...
    (microsoft.public.vc.mfc)
  • Re: GetPrivateProfileInt returns default value
    ... When you have global settings, there is a global AppData folder, but typically it ... even my ini file and key value are exists. ... I got GetPrivateProfileInt returns the nDefault. ...
    (microsoft.public.vc.mfc)
  • Re: GetSetting Equivalent
    ... > What is the equivalent of GetSetting when trying to read a .INI file. ... GetPrivateProfileInt ... WritePrivateProfileSection ... GetProfileInt ...
    (microsoft.public.dotnet.languages.vb)