How to read from an ini-file

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Duke

How to read from an ini-file

Post by Duke »

Hi
I want to load some settings from an ini-file.
Usualy I use GetPrivateProfileString(....) to read from the ini but if i use the irrlicht_engine ms vc++ tells me that 'GetPrivateProfileString ' is an undeclared identifier althought i included stdio.h & stdlib.h .
So what did i wrong ? or is there an other possibility to read inis :?:
Miwa
Posts: 28
Joined: Wed Feb 18, 2004 10:48 pm

Post by Miwa »

Did you include <windows.h> ?

I usually put the global scope operator on it to, as in ::GetPrivateProfileString()
Duke

Post by Duke »

if i include <windows.h> I get about 100 errors in vc98\include\unknwn.h :
'IUnknown' ambiguous symbol
disanti
Posts: 367
Joined: Sat Jan 17, 2004 1:36 am
Location: California, US
Contact:

Post by disanti »

I have the same problem when including windows.h! :(
________
Motorcycle Tires
Last edited by disanti on Tue Feb 22, 2011 8:01 am, edited 1 time in total.
Haddock
Posts: 15
Joined: Tue Dec 16, 2003 7:19 pm

Post by Haddock »

If you want to use GetPrivateProfileString() or similar ini functions, you must include <windows.h>.
Something must be wrong with the setup of your project or of your VC++ environnement. You shouldn't get these errors. With the VC++ wizard, try to create a simple windows application, and include <windows.h>. If it is working you have a problem with your project. If not, you have a problem with the setup of your VC++. Maybe you should reinstall or download the lastest PlatformSDK from Microsoft web site (don't do this if you don't have a broadband internet connection, it's a rather big download). The PlatformSDK contains all latest headers, librairies, ... for VC++.
Hope this help.
Miwa
Posts: 28
Joined: Wed Feb 18, 2004 10:48 pm

Post by Miwa »

If you are getting errors about IUnknown, make sure you include windows.h first. If you are using VC++, then just stick it in the stdafx.h (if you are using precompiled headers)
Duke

Post by Duke »

Miwa wrote:If you are getting errors about IUnknown, make sure you include windows.h first. If you are using VC++, then just stick it in the stdafx.h (if you are using precompiled headers)
that was it :D :D :D

Thank u all very much :)
Post Reply