Previously working code crashes with 1.5

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
Listing
Posts: 12
Joined: Wed Jan 28, 2009 9:30 am

Previously working code crashes with 1.5

Post by Listing »

This is the code that worked fine with Irrlicht 1.4 (tracked down to the bug)

Code: Select all

1:			HWND DrawBox = GetDlgItem(hWin, RC_DRAW);

			// create irrlicht device in the draw window
			
2:			SIrrlichtCreationParameters param;
3:			param.WindowId = reinterpret_cast<void*>(DrawBox); 
4:			param.DriverType = video::EDT_OPENGL;

5:			GlobalDevice = createDeviceEx(param);
6:			VideoDriver = GlobalDevice->getVideoDriver();
7:			if(GlobalDevice->isWindowActive() && GlobalDevice->run())
8:			{
9:			   VideoDriver->beginScene(true, true,0);
10:			  VideoDriver->endScene();	
11:		  }
I also tried it also with EDT_DIRECT3D9 and it is also non-working.
The crash occurs at instruction 9 or 10 with the error:
Run-Time Check Failure #0
The value of ESP was not properly saved across a function call.
This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
The same code was fully working with 1.4

Should I downgrade? Thank you a lot :(

Greetings
Listing
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

That error usually occurs when the Irrlicht headers/lib don't match the dll. Either you're using the 1.4 headers and Irrlicht.lib bwith a 1.5 Irrlicht.dll, or vice versa.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Listing
Posts: 12
Joined: Wed Jan 28, 2009 9:30 am

Post by Listing »

I feel stupid now, after replacing the dll with the new one it works like a charm.

Thanks for the fast and competent help and keep up the good work :o
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

No problem, it's hit all of us on Windows as some point. I've added it to the FAQ.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply