wondering if anyone could help with ini files maybe some examples also what would i invoke to count the kerys in a ini file

like the etc... so i can see how many keys exist
Posted on 2002-04-17 22:29:36 by illwill
In MSDN, look up "Registry Functions". Under "Obsolete functions" you'll see a list of API's to work with ini files :)
You can use GetPrivateProfileSectionNames to get the names of all the sections and then count the number of names.
Note that this is the easy to code / slow to run version. A simple CreateFile / ReadFile solution would definately be faster.
Posted on 2002-04-18 00:49:49 by Qweerdy
I endorse the use of the registry too. It is simple to deal with, there are APIs to do everything for you. It is also fast. The only time i would use an ini file is when you are wanting to save large amounts of data. Take a look through the MASM examples, there are three different registry example files (REGKEY2 and ENUMKEYS and REGDEMO), and you should find a registry library or two on Icz's site.
Posted on 2002-04-18 08:38:21 by sluggy
A good idea for a LIB is some routines that allow you to switch between using the registry and using an INI file. Getting values would be transparent as to where they are stored. Conversion would have to be made: registry <--> INI.
Posted on 2002-04-18 09:01:08 by bitRAKE
well unfortunatly the program im making is an addon to a crappy program that uses .ini files for everything i saves ,modifies etc.. the only registry entry it has is for its uninstall key which is kinda got me trying to figure out how to set the currentdir of the install directory "UninstallString"="C:\\Program Files\\programthatsux\\programthatsux.exe /uninstall" how would i shave off the programthatsux.exe /uninstall from the buffer that gets the reg key so i can just have it say X:\\Program Files\\programthatsux in the buffer?
Posted on 2002-04-18 11:02:19 by illwill
u can use a GetPathOnly func from MASM32Lib from MASM32v
7
Invoke GetPathOnly, ADDR string, ADDR buffer
Posted on 2002-04-18 13:22:51 by NEMO
Or you could search from the end of the string towards the start, looking for the first instance of "\\", then put a NULL char there, then you can just use the current string pointer is calling an API function. If using this method, be aware that your buffer will still be the same size even though your string is shorter (you don't want memory leaks now :) )
Posted on 2002-04-18 17:26:40 by sluggy

I endorse the use of the registry too. It is simple to deal with, there are APIs to do everything for you. It is also fast.


not only that, you can set an even larger smorgasbord of permissions, too :)
Posted on 2002-04-18 20:55:03 by jademtech