Hello,

I am trying to read a ini file but having some problems.

Suppose I have a ini file, "infoDat.ini". It contains:

Code:
[Guy]
name=Magni
id=5
[Girl]
name=Sarah
id=6
Now I am trying to read "id" key from section "Guy", here's what I did:

Code:
int getID;

getID = GetPrivateProfileInt("Guy", "id", -1, "infoDat.ini");
Now the problem is, the function always return -1. Why is that? Isn't it suppose to return 5?

Please help me!!!