Re: reading an ini file
- From: "CheckAbdoul" <checkabdoul at mvps dot org>
- Date: Wed, 19 Oct 2005 17:09:33 -0400
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
.
- Follow-Ups:
- Re: reading an ini file
- From: Joseph M . Newcomer
- Re: reading an ini file
- References:
- reading an ini file
- From: Z.K.
- Re: reading an ini file
- From: Joseph M . Newcomer
- reading an ini file
- Prev by Date: Re: Safe string functions in VC6
- Next by Date: Re: what events/massage are sent out?
- Previous by thread: Re: reading an ini file
- Next by thread: Re: reading an ini file
- Index(es):
Relevant Pages
|