Sample code for GetPrivateProfileString()

Apr 23, 2009 at 9:03am
I am trying to read data from an ini file. I have read the MSDN website regarding this function, but I don't have the slightest idea on how to implement it.

Can anyone post a sample code on reading an ini file? Thanks.
Apr 23, 2009 at 11:15am
closed account (S6k9GNh0)
There is a small open source project called IniReader somewhere on the internet. Go find it and it shows you a very secure way to do this.
Apr 23, 2009 at 12:10pm
Apr 23, 2009 at 12:44pm
http://msdn.microsoft.com/en-us/library/ms725501(VS.85).aspx

Wow that's some lengthy code! I only have 3 keys to read from my ini file. Do I really need that?
Apr 23, 2009 at 1:36pm
Not really.

Take what you want from the example. Once you get used to the WIN32 API, the parameters will become obvious.
Apr 23, 2009 at 1:47pm
closed account (S6k9GNh0)
http://www.codeproject.com/KB/cpp/IniReader.aspx

That's what I was talking about..
Topic archived. No new replies allowed.