Re: reading an ini file



Hi Joe,

Once can use the WritePrivateProfileStruct() to store any kind of data
in an .ini file. { like the window placement, etc }

--
Cheers
Check Abdoul
-----------------

"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:7e9dl1detj1ic0vrf364b199qijcgnoglm@xxxxxxxxxx
> Also be aware of the fact that using a .INI file has certain limitations.
For example,
> the entire file cannot exceed 64K, the whole style of using .INI files is
considered
> obsolete, and if you use GetPrivateProfileString you had better give a
COMPLETE path to
> the .INI file, and furthermore note that in some cases, site security will
write-protected
> installed executable directories to try to prevent certain security
exploits.
>
> Also, you can't store data that is hierarchical in a .INI file without a
lot of work. You
> get two levels: section and value. That's it. Now try to store
information about a font.
> It gets very clumsy. Try storing a window position.
>
> When possible, consider the Registry. See my Registry classes on my MVP
Tips site to see
> how easy this is to use. I also have classes to store fonts, window
placement, DWORD
> arrays, and other values easily.
> joe
>
>
> On Wed, 19 Oct 2005 11:10:34 -0700, "Z.K." <nospam@xxxxxxxxxx> wrote:
>
> >How do I get the information from an ini file into my program. I tried:
> >
> >CString strSection = "ProgramInfo";
> > CString strStringItem = "AppName";
> > CString strIntItem;
> >
> > CWinApp* pApp = AfxGetApp();
> >
> >
> > CString strValue;
> > strValue = pApp->GetProfileString(strSection, strStringItem);
> >
> > AfxMessageBox(strValue);
> >
> >All I get is a blank message box. This is the first time I have ever
> >done this so I am probably do something really wrong. Any pointers
> >would be appreciated.
> >
> > Z.K.
> Joseph M. Newcomer [MVP]
> email: newcomer@xxxxxxxxxxxx
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


.



Relevant Pages

  • Re: How to modify program files in Vista?
    ... You must change your program to store ... If there is an application ini file that is common to all users there ... What Microsoft would like developers to do is to store the configuration ... subdirectory of the user's user profile folder. ...
    (microsoft.public.vc.mfc)
  • Re: How to modify program files in Vista?
    ... You must change your program to store ... If there is an application ini file that is common to all users there ... What Microsoft would like developers to do is to store the configuration ... subdirectory of the user's user profile folder. ...
    (microsoft.public.vc.mfc)
  • Re: Exmerge Error Please Help
    ... >>PST of a single mailbox, ... >>Community College,CN=Microsoft ... > from INI file: 0 ... > store databases, read ...
    (microsoft.public.exchange2000.admin)
  • Re: Image Combo - Please help.
    ... > Controls do not have memory, so they don't know what you selected last ... You must store that information yourself (in ... > registry, an INI file, a plain text file, whatever... ... >>> combo has a ListIndex property anyway... ...
    (microsoft.public.vb.general.discussion)
  • Re: reading an ini file
    ... Also be aware of the fact that using a .INI file has certain limitations. ... you can't store data that is hierarchical in a .INI file without a lot of work. ... See my Registry classes on my MVP Tips site to see ...
    (microsoft.public.vc.mfc)