anyone help me out here? I need to know how to read from a ini file i read other sites and they all dont work
anyone help me out here? I need to know how to read from a ini file i read other sites and they all dont work
An INI file is simply a text file with [headers] followed by name/attribute pairs. There's shouldn't be any problem with opening and reading such a file. Can you be more specific than "they all don't work"?
lol im talking about having a C++ program read the info in the ini and using it to plug into somewhere else
>im talking about having a C++ program read the info in the ini
Okay, that's equally trivial privided your data is valid.
>and using it to plug into somewhere else
To "plug" into what, how? I'll need details if I'm going to help you or send you somewhere that you can be helped if I can't.
im making a bot for a game i play and i need the thing to read the ini file and get the AccountName then put it in then get AccountPass and put it in then the CharacterLocation..
That's much more descriptive, thank you. Now what have you been trying that doesn't work?Originally Posted by GuardianBarak
i appoligize for not being descriptive, i've been looking at sites and such for programming and they show ways of reading it but they dont work...heres one example of what they showed me
::EDIT:: what would i need for the header? #include whatCode:BOOL Get(LPCTSTR pszSection, LPCTSTR pszEntry, int &nVal); BOOL Set(LPCTSTR pszSection, LPCTSTR pszEntry, int nVal); BOOL Set(LPCTSTR pszSection, LPCTSTR pszEntry, COLORREF rgb); BOOL Get(LPCTSTR pszSection, LPCTSTR pszEntry, COLORREF &rgb);
Last edited by GuardianBarak; 07-16-2004 at 08:18 PM.
Err..whenever i do that it says something about the CString thing
"It says something about the CString thing" really doesn't give us much to go on. Post an actual error message.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
"CString was not declaired in this scope" and, "CStringArray was not declaired in this scope"
how about just using GetPrivateProfileString() function?
How about posting some code.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
>"CString was not declaired in this scope" and, "CStringArray was not declaired in this scope"
You realize that you're trying to work with MFC, right? I get the impression that you have no idea what MFC is or how to use it. Maybe a good book is in order before you go any further.
are the game u playing called Tibia?