Illusioned
July 6th, 1999, 06:29 PM
Im trying to read an INI file, but it keeps coming up with the default entry.. I know the ini file exists and the key and section im looking for exist.. is there something wrong with this function?
char *ReadINIVal(const char* Section, const char* Key, const char* INIFN)
{
char buffer[2000];
char er[100] = "Could Not Read Initialization Value: ";
BOOL ret;
ret = GetPrivateProfileString(Section, Key, "ER_NF", buffer, 2000, INIFN);
if ((ret == 5) & (strcmp(buffer, "ER_NF")==0)) MessageBox(MainhWnd, strcat(er, Key), INIFN, MB_OK|MB_ICONEXCLAMATION );
return(buffer);
}
any help would be greatly appreciated.. Thanks in advance
Illusioned
char *ReadINIVal(const char* Section, const char* Key, const char* INIFN)
{
char buffer[2000];
char er[100] = "Could Not Read Initialization Value: ";
BOOL ret;
ret = GetPrivateProfileString(Section, Key, "ER_NF", buffer, 2000, INIFN);
if ((ret == 5) & (strcmp(buffer, "ER_NF")==0)) MessageBox(MainhWnd, strcat(er, Key), INIFN, MB_OK|MB_ICONEXCLAMATION );
return(buffer);
}
any help would be greatly appreciated.. Thanks in advance
Illusioned