SEHException when creating MOIS objects (i.e. mouse)


09-01-2014 12:15:35


i tried to use MOIS for input and based on the tutorial, it should be easy. However, i keep getting the SEHException when i try to create mouse object. Below are my codes, which are similar to the tutorials:

MOIS.InputManager InputMgr;
MOIS.Keyboard InputKeyboard;
MOIS.Mouse InputMouse;

public void InitMOISInput()
MOIS.ParamList pl = new MOIS.ParamList();
IntPtr windowHnd;
mWindow.GetCustomAttribute("WINDOW", out windowHnd); // window is your RenderWindow!
pl.Insert("WINDOW", windowHnd.ToString());

InputMgr = MOIS.InputManager.CreateInputSystem(pl);

// Create all devices (except joystick, as most people have Keyboard/Mouse) using unbuffered input.
InputKeyboard = (MOIS.Keyboard) InputMgr.CreateInputObject(MOIS.Type.OISKeyboard, false);
InputMouse = (MOIS.Mouse) InputMgr.CreateInputObject(MOIS.Type.OISMouse, false);

the InputMgr is successfully initialized, but when it try to create the InputKeyboard, the SEHException will appear. Upon removing the InputKeyboard line, the same Exception appear on the InputMouse line.

below is the exception details:

OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightSpecularColor does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\ogre\OgreMain\src\OgreGpuProgramParams.cpp (line 1433)


1. I created my program based on the Basic tutorial - embedding Mogre in windows.forms

2. All dlls that i used are from the QuickStart2010 Improved Version (with MOIS). MOIS sucessfully initialized in the Quickstart solution.

3. Without MOIS, everything works as expected.

4. All references had been added to the project.

i've tried to solve this for days but still got the same error. any idea on how to solve this? I really need the solution fast and i really appreciate it if anyone can help me on this..

Thank you.


20-01-2014 19:08:44

Hi ZeroCapt

OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightSpecularColor does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\ogre\OgreMain\src\OgreGpuProgramParams.cpp (line 1433)
MOIS is a wrapper for OIS.
Maybe you have incompatible file version of MOIS.dll and OIS.dll.
There are also builds, where the content of OIS.dll was included to the MOIS.dll file (static linked at compile time). In this case you just need MOIS.dll.

An other option could be that lightSpecularColor is a needed material definition, which isn't found on your resource files.
But in this case, normally you get just a warning and the message text is different.

Just ideas - but I don't know the truth.

My suggestions:
Use the easy to use MogreBuilder tool with the option -mois.
So Mogre including OIS and MOIS should be compiled.

Use my binary package from here.
It doesn't contain MOIS (because I never used it), but I added all needed header files of Ogre and Mogre.
By this it should be easy to compile MOIS on your own.

Try the binary bundle of the "Cygon builds", which are a little bit older.
There MOIS should be included.

I hope this helps.


30-01-2014 01:53:14

i solved the lightspecularcolor exception by removing the material from the resource.cfg file. But im still having the same problem with MOIS. i still can't create MOIS objects.

System.Runtime.InteropServices.SEHException was unhandled
Message=External component has thrown an exception.
at OIS.InputManager.createInputObject(InputManager* , Type , Boolean , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* )
at MOIS.InputManager.CreateInputObject(Type iType, Boolean bufferMode)
at Quickstart2010.Modules.MoisManager.Startup(IntPtr _windowHandle, Int32 _width, Int32 _height) in C:\MogreSDK\mogre-mogrequickstart-dedcdafbd3a7\Quickstart2010\Quickstart2010\Modules\MoisManager.cs:line 77
at Quickstart2010.Modules.StateManager.Startup(Type _firstState) in C:\MogreSDK\mogre-mogrequickstart-dedcdafbd3a7\Quickstart2010\Quickstart2010\Modules\StateManager.cs:line 59
at Quickstart2010.OgreForm.Init() in C:\MogreSDK\mogre-mogrequickstart-dedcdafbd3a7\Quickstart2010\Quickstart2010\OgreForm.cs:line 48
at Quickstart2010.Program.Main() in C:\MogreSDK\mogre-mogrequickstart-dedcdafbd3a7\Quickstart2010\Quickstart2010\Program.cs:line 26

I've tried to compile Mogre but the problem is still there. However, i found out that the exception occurs when i render ogre on a form control (i.e. picture box). i've tested this using the QuickStart solution. If i create a render window using a picture box, the exception will occur. But i still have no idea how to resolved this problem. I need help. fast. Thank you very much.


10-02-2014 10:55:38

Solved it. Found the solution's link in the WAREHOUSEJIM's Howtos.

This post should be added to the main tutorial list. Very important for newbies like me.


10-02-2014 17:49:32

Thanks for your feedback.
I'm happy to see that you could solve the problem.

I'm not shure, what exactly was the problem. The linked topic contains much information. Which is (or are) the related post(s)?

Nice would be if you extend the tutorial wiki page yourself, because you worked through the tutorial and understood the details.
To edit the wiki, log in with the name and password of the ogre main forum.
(For this you need to register in the main forum. The account for Mogre in this addons forum doesn't work.)


10-02-2014 18:02:54

By your inspiration I added more links to the MOIS wiki page.