I could not find the getPrivateProfileString in the WinApi-class.
This is needed when reading a key-value from an INI-File. So for
anyone who is interested, here it is. Or did I mess up my winApi-
class that bad, that this method was lost?


client static str getPrivateProfileString(str section, str key, str
value, str file)
{
#WinAPI
#define.sizeOfStringValue(1024)
Binary stringValue;

DLL         DLL       = new DLL(#KERNELDLL);
DLLFunction method    = new DLLFunction
(DLL, 'GetPrivateProfileStringA');
stringValue           = new Binary(#sizeOfStringValue);

method.returns(ExtTypes::DWord);
method.arg(ExtTypes::String,  //section
ExtTypes::String,  //key
ExtTypes::String,  //default value
ExtTypes::Pointer, //value
ExtTypes::DWord,  //Size
ExtTypes::String); //file

method.call(section, key, value, stringValue, #sizeOfStringValue,
file);

return stringValue.string(0);
}



/b



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to