SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Reading the content of an ini file section

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Reading the content of an ini file section
Author Message
nick



Joined: 12 Jan 2004
Posts: 3

Post Reading the content of an ini file section Reply with quote

I need to read the entire content of an ini file section.
I tried to use the kerbel32 function:

DWORD GetPrivateProfileString(

LPCTSTR lpAppName,

LPCTSTR lpKeyName,

LPCTSTR lpDefault,

LPTSTR lpReturnedString,

DWORD nSize,

LPCTSTR lpFileName
);

The problem is how to specify a NULL value for the second parameter (this should force the function to read all the section content).
This solution doesn't work:
Call "kernel32.dll", "GetPrivateProfileString", "SLSSuSu", True, section, 0, "", buffer, 1024, inifile, result

Any ideas?

Thank You for the attention.

Mon Jan 12, 2004 6:57 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Reading the content of an ini file section Reply with quote

Why not to use a simple method
FileReadAll inifile, result

PS. Specify 0 for the second parameter if using "GetPrivateProfileString"
NULL for a pointer means 0.

: I need to read the entire content of an ini file section.
: I tried to use the kerbel32 function: DWORD GetPrivateProfileString(

: LPCTSTR lpAppName,

: LPCTSTR lpKeyName,

: LPCTSTR lpDefault,

: LPTSTR lpReturnedString,

: DWORD nSize,

: LPCTSTR lpFileName
: );

: The problem is how to specify a NULL value for the second parameter (this
: should force the function to read all the section content).
: This solution doesn't work: Call "kernel32.dll",
: "GetPrivateProfileString", "SLSSuSu", True, section,
: 0, "", buffer, 1024, inifile, result

: Any ideas?

: Thank You for the attention.

Mon Jan 12, 2004 10:16 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.