Link to home
Start Free TrialLog in
Avatar of JimKirby
JimKirby

asked on

Get data from .ini file?

I must be overlooking something really basic. I'm building a new version of an application that was using .ini files to store various data. But, when Setup installs my new version, I want to switch to using the Registry. I want Setup to read the .ini file data and copy it into the Registry.

Trouble is, I am having no luck finding a way to get VB5 to read from the .ini file! I first tried the GetSetting function, but no luck--just returns an empty string every time. Surely, there must be a way. Ideas, anyone?!
Avatar of JimKirby
JimKirby

ASKER

I could add a reference to MS Word, and us "system.PrivateProfileString(...)", but that seems to be a bit awkward...
   jk
ASKER CERTIFIED SOLUTION
Avatar of Dr. Kamal Mehdi
Dr. Kamal Mehdi
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
BTW, the lpAppName$ is the section name. ex. Desktop.
The value of the key you read is returned in the ReturnValue$ argument.
This is good stuff! I would never have thought of the API call approach. Microsoft's VB documentation was surely no help at all. Thank you!  jk
You are welcome.
Regards.