News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GetPrivateProfileString Question

Started by starzboy, July 07, 2009, 09:39:57 AM

Previous topic - Next topic

fearless

Quote from: Mark Jones on July 08, 2009, 09:44:27 PM
... but no .ini file necessary, nor registry. Such would be a true single-file distribution.

Just wondering if you could embed your config settings as a resource (string or raw) and use UpdateResource to write the changes, and FindResource and LoadResource as the read part. Could be handy to create a couple of wrapper functions to provide the read/write, and name them something like LocalIniReadString, LocalIniWriteString or whatever.
Ć’earless

starzboy

Hello
I was trying GetPrivateProfileStruct but I dont seem to be getting along.
I have renamed my ini file to xuz.abc, but format is ini

invoke   GetPrivateProfileStruct,chr$("1"),chr$("MyApp"),addr buffer,sizeof buffer,addr hpath
This seems to giveme a NULL answer.

contents of inifile:
[1]
MyApp=test

When I use GetPrivateProfileString, I get the answer but GetPrivateProfileStruct fails.
Please help.

travism

Because it must have been written with WritePrivateProfileStruct because GetPrivateProfileStruct calculates a checksum, msdn is here:
http://msdn.microsoft.com/en-us/library/ms724356(VS.85).aspx