Re: INI formatting



You are right Kevin.
But just open HKLM\Software and you'll see a lot of entries including
Microsoft's with program settings.
So, Microsoft teaches us not to use HKLM, but it uses itself.
Many other companies (at least I see on my machine) such as Adobe, Symantec
use HKLM too.

vovan

"Kevin Provance" <casey@xxxxxxxxxxx> wrote in message
news:OqAU7MEsHHA.4932@xxxxxxxxxxxxxxxxxxxxxxx
I don't understand this. Programs were never supposed to use HKLM for
specific settings. Apps were supposed to be using HKCU...at least that's
what I was taught. By this rule, I've never experienced any problems
using
the registry in Vista. But I can see where this restriction in Vista
would
make it difficult to have settings on a global basis, rather than per
user.
That I never understood either. It's like MS wants to force developers to
do settings on a per user basis. It should be the developers choice.

The only problem I ever had with INIs was curious end users trying to edit
them by hand and futzing things up...but I suppose if you have a
determined
end user, they'll screw anything up regardless where it is. That's their
job after all. :/

"vovan" <someone@xxxxxxxxx> wrote in message
news:u%230oh6CsHHA.3628@xxxxxxxxxxxxxxxxxxxxxxx
|I know that Vista doesn't allow to do many things in Program Files, so I
| moved my application to C:\MyCompanyNam\MyProgram.
| With the registry everything was fine - Vista moved itself my stuff from
| LocalMachine hive to the other place. It was working on Vista Business.
On
| Vista Home the problem with Registry appeared.
| So I decided to get rid of registry using. I'm going to move registry
stuff
| into INI file located in C:\MyCompanyNam\MyProgram.
|
| vovan
|
| "JP Bless" <jp3BlessNoSpam@xxxxxxxxxxx> wrote in message
| news:OfwLVoCsHHA.4104@xxxxxxxxxxxxxxxxxxxxxxx
| > Slightly off topic...
| > Note that Vista blocks writing to INI file if the INI is located in
| > Program Files. I had a situation where I had to manually copy INI from
| > Program Files to C:\ before I could edit the file. I ran into this
| > situation last week but I have no idea if this is a common/standard
| > problem in Vista
| >
| > "vovan" <someone@xxxxxxxxx> wrote in message
| > news:ekaTwlBsHHA.1848@xxxxxxxxxxxxxxxxxxxxxxx
| >> I'm switching from Registry to INI file to store program settings
(Vista
| >> made me to do that).
| >> I'm trying to use this approach to write to INI file:
| >>
| >> Public Sub WriteKeyValue(sSection As String, sKey As String,
sKeyValue
As
| >> String)
| >> Dim lngResult As Long
| >> lngResult = WritePrivateProfileString(sSection, sKey, sKeyValue,
| >> m_FileName)
| >> End Sub
| >>
| >> I'm getting not separated entries in the INI file like this:
| >> [Section1]
| >> MyKeyValue1=Value1
| >> MyKeyValue2=Value2
| >> MyKeyValue3=Value3
| >> [Section2]
| >> MyKeyValue21=Value21
| >> MyKeyValue22=Value22
| >> MyKeyValue23=Value23
| >> [Section2]
| >> MyKeyValue31=Value31
| >> MyKeyValue32=Value32
| >> MyKeyValue33=Value33
| >>
| >> I checked the format of several existing on my PC INI files and
noticed
| >> that they have separation between sections, like this:
| >> [Section1]
| >> MyKeyValue1=Value1
| >> MyKeyValue2=Value2
| >> MyKeyValue3=Value3
| >>
| >> [Section2]
| >> MyKeyValue21=Value21
| >> MyKeyValue22=Value22
| >> MyKeyValue23=Value23
| >>
| >> [Section2]
| >> MyKeyValue31=Value31
| >> MyKeyValue32=Value32
| >> MyKeyValue33=Value33
| >>
| >> A can add vbNewLine when I'm adding the last Key to the Section.
| >> But because I have a lot of Registry entries I need to move to INI
file
| >> I'm afraid that I will lose control which line is the last one.
| >> I would prefer to add a blank line BEFORE any section. I think it
would
| >> simplify the writing to the file when a new Key is added or the value
of
| >> the existing one is changed.
| >> I used Google but found nothing.
| >>
| >> Thank you
| >> vovan
| >>
| >
| >
|
|




.



Relevant Pages

  • Re: Best way to use INI file
    ... I was told that there may be some issues with the security settings on ... I didn't have a way to test writing to the registry and I ... Is there any particular reason you are using an INI file rather ... than GetSettings and SaveSetting to store data in the registry. ...
    (microsoft.public.excel.programming)
  • Re: INI formatting
    ... I know that Vista doesn't allow to do many things in Program Files, ... Vista Home the problem with Registry appeared. ... Note that Vista blocks writing to INI file if the INI is located in ...
    (microsoft.public.vb.general.discussion)
  • Re: Best way to use INI file
    ... I was told that there may be some issues with the security settings on ... I didn't have a way to test writing to the registry and I ... Is there any particular reason you are using an INI file ... rather than GetSettings and SaveSetting to store data in the registry. ...
    (microsoft.public.excel.programming)
  • Re: Reg/INI Discussion from much earlier
    ... >in the event of an improper shutdown, the registry is NOT saved. ... >uncontrolable factor and the user wants to save his/her settings. ... Using both the Registry and the INI file has got to be /slower/ than ... I should really do a similar test with FileMon ...
    (microsoft.public.vb.general.discussion)
  • Re: SaveSettings / GetSettings
    ... |>>> I am trying to decide between using the registry or an INI file. ... | I'm still of a mind that simply saying Vista is an unsupported environment ... | path of least resistence, for specific user settings, there's nothing ...
    (microsoft.public.vb.general.discussion)