Solved

*INI File

Posted on 2001-06-21
4
291 Views
Last Modified: 2013-12-03
Hi I wanna call a INI file to get some data to my progam.. I can use, GetPrivateProfileInt(..) function, but then I will open the INI file evry time I call the function, for performace resons I can't let that happen.. Can I make a pointer to the "ini_ile", that I can pass into my GetPrivateProfileInt(..) function instead of a file ??


Then I wont have to load the file for evry time I need some settings..

Whow is that done ?
0
Comment
Question by:win32
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
jlsjls earned 20 total points
ID: 6214854
I think the normal use of an ini file is to read it once when you start your application. Then you open the ini file , retrieve all the settings from the ini-file into variables, close the ini file and start the other work of your application. So you don't have any performance problems.
0
 

Expert Comment

by:jhully
ID: 6230714
Some not very good but useful solution:
create mdb file (access) and work with it by ADO.
If the ini won't be big, it will be useful.
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 6248995
>>Then I wont have to load the file for evry time I need some settings..
For this I wrote class (TIni), that make this, but it is not 20 pts!

0
 

Expert Comment

by:jhully
ID: 6265371
How do you like next variant:
create .xml file and load it only once by DOM or somethink like this. But... this solution won't allow to you to use changed values of ini.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video discusses moving either the default database or any database to a new volume.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now