I've got a totally weird problem. I hope that someone can help me out.... I'm working on a project with the following self made classes:
Code: Select all
IGlobals.h (typedefs & #include <irrlicht.h>)
IElement.h (base class for class ISimulation)
ISimulation.h (a structure to save xml data)
IXML.h (Loads XML Data an saves it to a ISimulation instance)
ICore.h (visualization)
ISimulationManager.h (main prog)
IEventManager.h (handle key / GUI events)
IGUI.h (drawing buttons etc...)
Code: Select all
IElement.h (incl. IGlobals.h)
ISimulation.h (incl. IElement.h)
-------------------------------------------------
ICore (incl. ISimulation.h)
IGUI (incl. IGlobals.h)
-------------------------------------------------
IEventManager(incl. ICore.h && IGUI.h)
-------------------------------------------------
ISimulationManager(incl. IEventManager.h)
-------------------------------------------------
IXML (incl. ISimulation.h)
I wanted to include it in the IEventManager too, but
then I get these strange errors :
Code: Select all
1>Compiling...
1>IrrAOR.cpp
1>d:\dokumente\programmierung\c++\irraor\irraor\ixml.h(63) : error C2664: 'const wchar_t *irr::io::IIrrXMLReader<char_type,super_class>::getAttributeValue(int) const' : cannot convert parameter 1 from 'const char [5]' to 'int'
1> with
1> [
1> char_type=wchar_t,
1> super_class=irr::IReferenceCounted
1> ]
1> There is no context in which this conversion is possible
1>d:\dokumente\programmierung\c++\irraor\irraor\ixml.h(64) : error C2664: 'const wchar_t *irr::io::IIrrXMLReader<char_type,super_class>::getAttributeValue(int) const' : cannot convert parameter 1 from 'const char [5]' to 'int'
1> with
1> [
1> char_type=wchar_t,
1> super_class=irr::IReferenceCounted
1> ]
1> There is no context in which this conversion is possible
1>d:\dokumente\programmierung\c++\irraor\irraor\ixml.h(65) : error C2664: 'int irr::io::IIrrXMLReader<char_type,super_class>::getAttributeValueAsInt(const char_type *) const' : cannot convert parameter 1 from 'const char [3]' to 'const wchar_t *'
1> with
1> [
1> char_type=wchar_t,
1> super_class=irr::IReferenceCounted
1> ]
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\dokumente\programmierung\c++\irraor\irraor\ixml.h(74) : error C2440: '=' : cannot convert from 'const wchar_t *' to 'const char *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\dokumente\programmierung\c++\irraor\irraor\ixml.h(83) : error C2664: 'strcmp' : cannot convert parameter 2 from 'const wchar_t *' to 'const char *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\dokumente\programmierung\c++\irraor\irraor\ixml.h(83) : fatal error C1903: unable to recover from previous error(s); stopping compilation
heres a short cut-out of the IXML.h :
Code: Select all
#include "ISimulation.h"
struct node_tupel
{
const char* name;
EXML_NODE type;
};
class IXML
{
private:
IrrlichtDevice* device;
IFileSystem* fs;
IXMLReader* xml;
ISimulation* simData;
u32 step_nr;
node_tupel node;
public:
IXML(IrrlichtDevice* dev, ISimulation* simulation);
~IXML() {};
ISimulation* read_XML(c8* xml_file, IrrlichtDevice* device);
private:
Property get_AttributeSlot();
ElementHead get_ElementHead();
node_tupel get_Node();
void read_SimulationParameters();
void read_SingleObject();
void read_SingleAgent();
void read_SingleStep();
void read_Objects();
void read_Agents();
void read_Steps();
};
IXML::IXML(IrrlichtDevice* dev, ISimulation* simulation)
: step_nr(0), device(dev), simData(simulation)
{
fs = device->getFileSystem(); // getting pointer to the IFileSystem
};
Property IXML::get_AttributeSlot()
{
Property p;
p.name = xml->getAttributeValue(0);
p.value = xml->getAttributeValue(1);
return p;
};
ElementHead IXML::get_ElementHead()
{
ElementHead head;
head.name = xml->getAttributeValue("name");
head.type = xml->getAttributeValue("type");
head.id = xml->getAttributeValueAsInt("id");
return head;
};
node_tupel IXML::get_Node()
{
node_tupel n;
n.name = xml->getNodeName();
n.type = xml->getNodeType();
return n;
};
void IXML::read_SimulationParameters()
{
// read forward till Parameters Node reached
while (strcmp("SimulationParameters", xml->getNodeName())) xml->read();
while (xml && xml->read())
{
if (!strcmp("Slot", xml->getNodeName()))
simData->insert_Parameter(get_AttributeSlot());
if (!strcmp("SimulationParameters", xml->getNodeName()) && xml->getNodeType() == EXN_ELEMENT_END) break;
}
};
uah, hope someone gets what i wanted to say...
manyyyy thx in advance
greets
paddy
[/code]