Open a configuration file of given type.
DWORD CfgFileOpen(
CFG_TYPE type,
LPCSTR szPath,
CFGFILE* pFile,
LPCSTR* pMsg
);
Parameters
type
- (in) The type of file to open. One of CFG_SECTION, CFG_NET_EQUAL, or CFG_NET_SPACE. All other types are for internal use or deprecated and not allowed on this function.
szPath
- (in) Complete file and path.
pFile
- (out) Retrieves the file handle on success. Can be used further on to change content, save and close the file.
pMsg
- (out) If not null, will point to an error description in case an error occured during open.
Return values
ECFG_OK for success or an error code on failure.
Remarks
Opens a file of given type, reads the content into internal buffer and closes the file on disc. CfgFileClose have to be called later on to free the file handle.
Errors
ECFG_PARSEWARN
- Warning during parsing of file (non fatal)
ECFG_NOTFOUND
- File specified in szPath not found or could not be read
ECFG_MEM
- Not enough memory
ECFG_WRONGFILETYPE
- Wrong file type was specified for type
See Also