IAttributes

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
bloodbao
Posts: 15
Joined: Fri Aug 31, 2007 1:12 pm

IAttributes

Post by bloodbao »

why in my function,it catch an expection?

Code: Select all

GRF3D::GRF3D(unsigned long Handle, s32 Witdh, s32 heigh){ 
	//*
    SIrrlichtCreationParameters params; 
    params.WindowId =   (void *) Handle ; 
	params.DriverType = EDT_DIRECT3D9; 
    params.WindowSize = dimension2d<s32>(Witdh,heigh); 
   params.EventReceiver = &receiver;

   device = createDeviceEx(params); 
   if (device != 0){ 
         device->setResizeAble(true); 
         env = device->getGUIEnvironment(); 
         driver = device->getVideoDriver(); 
         smgr = device->getSceneManager(); 
    } 
	io::IFileSystem* ifs=device->getFileSystem();
	ifs->createAndOpenFile("ff.h");///ok!
	ifs->getWorkingDirectory() ;///ok!
	ifs->addZipFileArchive("ff.zip");////ik!
	//ifs->createXMLReader("config.xml");///error
	//ifs->createEmptyAttributes(driver);///error
	//ifs->createXMLWriter(driver);///error
}
First-chance exception at 0x00846f11 in SceneEdit.exe: 0xC0000005: Access violation reading location 0x782e676d.
Unhandled exception at 0x00846f11 in SceneEdit.exe: 0xC0000005: Access violation reading location 0x782e676d.
The program '[2924] SceneEdit.exe: Native' has exited with code -1073741819 (0xc0000005).
how can i dear with it?
Last edited by bloodbao on Sat Apr 26, 2008 9:43 am, edited 1 time in total.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Do you actually have two devices? I don't see where you initialize the pointer at m_wnd->device. What happens if the above createDeviceEx() call fails? What will driver point to? What happens when you call createEmptyAttributes() with that 'bad' driver pointer?

Regardless, the best thing to do is get familiar with your debugger and use it to find out what is going on.

Travis
bloodbao
Posts: 15
Joined: Fri Aug 31, 2007 1:12 pm

Post by bloodbao »

Actually,m-wnd->device is the same as device.
I want to know why it returns bad point!
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

How the hell should we know? We don't know what state the rest of your system is in. No matter how many exclamation! marks you use.

Please don't post your application problems in the Bugs forum. The chances of this being a bug with Irrlicht is as close to zero as makes no difference.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
bloodbao
Posts: 15
Joined: Fri Aug 31, 2007 1:12 pm

Post by bloodbao »

sorry,i made a mistake!
The problem solved!
Thanks vitek!
Post Reply