Re: registry entry or file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

r_z_aret_at_pen_fact.com
Date: 08/13/04


Date: Fri, 13 Aug 2004 13:03:22 -0400

On Thu, 12 Aug 2004 08:41:02 -0700, Raj
<Raj@discussions.microsoft.com> wrote:

>
>Thanks for reply.
>
>Is there any specific use if I write my data in INI file instead of text
>file. Is there any specific format to follow in INI file.

An ini file _is_ a text file. If you are not sharing the file with any
other application, you can use your own format/syntax. Or you can use
GetPrivateProfileString and relatives. But note that they work with
registry, rather than ini files, under some circumstances. For more on
that, use google to look up threads that include that string and
contributions from me (at least one provides the info while correcting
misinformation from me).

>
>Which directory should I use for such a file. I want to secure data and make
>it read only. Should I copy it to system directory so that other users will
>not have write permission.

Good question. I think the "proper" answer for Win2k and WinXP is in
the user's setting directory. And I _think_ the relevant Win32
function for finding that is SHGetSpecialFolderLocation or
SHGetSpecialFolderPath. I'm quite sure the system directory is the
wrong place.

>
>I appreciate any reference articles on these topics.
>
>Thanks
>
>
>
>"r_z_aret@pen_fact.com" wrote:
>
>> I rather strongly believe in avoiding shared resources, such as the
>> registry, unless necessary. So I strongly favor separate file(s).
>>
>> This question has stirred some lively discussions in the past. I just
>> used google () to look up
>> registry ini
>> and got 129000 hits! That would be a _lot_ to wade through, but you
>> will probably get a good range of opinions quickly. If you want to
>> narrow down the list, I suggest looking for my contributions (yes, I
>> am biased towards my opinion, but I feel justified mentioning this
>> method as a way to find interesting _threads_, including some that
>> prompted me to spout my opinion because they disagree with me).
>>
>>
>> On Wed, 11 Aug 2004 08:17:02 -0700, Raj
>> <Raj@discussions.microsoft.com> wrote:
>>
>> >
>> >I have Dll which would need non-volatile data which is persistent across
>> >reboots. This data is ten 32-bit integer values and 60 character string. This
>> >data is write-once/read-always. This is product data associated with PC.
>> >Assume PC itself is customised product.
>> >
>> >This dll will be distributed in products(laptops or PCs) and used by PC
>> >Applications. Two ways to do it. Either make registry entry specific to my
>> >dll and my dll process can read everytime. Or I can write a file and
>> >distribute this file along with dll.
>> >
>> >Please convince me which is better way to go. Coming to installation, I dont
>> >see any difference. I have to either run installation program once and make
>> >an entry to registry or simply copy the file. Both ways it has to be manual.
>> >Performance is not issue because Dll will be reading just once for first time
>> >when it is loaded.
>> >
>> >Any security issues? Arguebly registry itself is saved on some file(in some
>> >way I am not aware).
>> >
>> >Thanks
>>
>> -----------------------------------------
>> To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).
>>
>> Robert E. Zaret, eMVP
>> PenFact, Inc.
>> 500 Harrison Ave., Suite 3R
>> Boston, MA 02118
>> www.penfact.com
>>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com



Relevant Pages

  • Re: Config file Parser
    ... I also need a parser for this file. ... The INI file format is natively not heirarchical, ... XML might be appropriate but probably isn't practical. ...
    (comp.unix.programmer)
  • Re: QuickBasic 4.5 Colours
    ... In the editing mode, it was difficult to read watch point values, ... While QB only allows you to change 3 color settings, ... like 20 some stored in the INI file. ... have a different format. ...
    (comp.lang.basic.misc)
  • Re: [OT] ini files
    ... mirco wrote: ... > a library that manages ini file (text, xml, the format you want but ... Are the initialization files the same format under Windows ... C++ Faq: http://www.parashift.com/c++-faq-lite ...
    (comp.lang.cpp)
  • Re: The hard coded links in the VB6 apps to the Access databases
    ... Please send me an example of code in Ini file. ... The example code I posted will work just fine if you ONLY store the path ... the datapath.ini was not really in ".ini" format, ... if you do want code to actually read/write a .ini file...then see ...
    (microsoft.public.access.gettingstarted)