Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: 1 [2]

Author Topic: Exception on InputMgr Creation  (Read 3277 times)

Penguin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 12
    • View Profile
Re: Exception on InputMgr Creation
« Reply #15 on: April 21, 2008, 09:30:06 AM »

After debugging both the commandline demo and my program, and comparing variable values, I have figured out that for some reason the mInputManager pointer is corrupted or something. It keeps saying "Children could not be evaluated" while the demo had values. Now to figure out why.
Logged

OvermindDL1

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 288
    • View Profile
    • http://www.overminddl1.com/forum/
Re: Exception on InputMgr Creation
« Reply #16 on: April 21, 2008, 11:10:48 AM »

I still use VC7.1 personally (although I have 6.0 and 8.0 as well, but hence why I like CMake, google it, it is a multi-platform make system that can create project files for just about any IDE/compiler out, everything from GCC to DevC++ to Visual Studio 6 to 9 and others).  I will take a look at it later today if I get a free moment.

EDIT1:  Hmm, yea, way too big for a reduced test-case, anything smaller (and not in VS9, although that would not matter if you can get it down to one file)?

EDIT2:  Things look fine from an initial look, looks pretty identical to what I do...

EDIT3:  I think I may have found it, you are not compiling your project as C++ files, you are compiling them as C++/CLR, fix that and I'd bet it would work (well, mostly because I do not see anything else wrong and I know /CLR breaks some things).  Remember, *never* touch anything that says /CLR or Managed when dealing with C++, Microsoft loves to microshaft you when you do that (they are trying to break the C++ standard with those).  Not to mention that running in /CLR or Managed modes slows down your app.
« Last Edit: April 21, 2008, 11:53:04 AM by OvermindDL1 »
Logged

Penguin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 12
    • View Profile
Re: Exception on InputMgr Creation
« Reply #17 on: April 21, 2008, 11:59:52 AM »

I have succeeded in compressing it down to a single file. I've compiled it on my computer and it has crashed at the same place.
http://www.robertjacques.com/main.cpp
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Re: Exception on InputMgr Creation
« Reply #18 on: April 21, 2008, 12:20:40 PM »

Hmm, you may want to take a look at OvermindDL1's third edit - may be the issue. Because, I just took your main file, replaced Ogre's Terrain Demo with the file, rebuilt it real quick, and started/created things nicely. Of course, then it ended since there is just a return after stating input. So, no crazy exception for sure and values looked fine. I used prebuilt OIS modules from Ogre dependencies, so did not step into OIS, but didn't see any reason to since it looked ok.

Logged

OvermindDL1

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 288
    • View Profile
    • http://www.overminddl1.com/forum/
Re: Exception on InputMgr Creation
« Reply #19 on: April 22, 2008, 12:10:18 PM »

So does that third edit of mine fix it?
It is in your project config, I can look-up the exact place if you want, but you should know it if you use VS.
Logged

Penguin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 12
    • View Profile
Re: Exception on InputMgr Creation
« Reply #20 on: April 22, 2008, 01:20:21 PM »

Yep That fixed it! Thanks
Logged

OvermindDL1

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 288
    • View Profile
    • http://www.overminddl1.com/forum/
Re: Exception on InputMgr Creation
« Reply #21 on: April 22, 2008, 03:14:56 PM »

Do remember, C++ libraries rarely work in C++'ish Microsoft psuedo-languages, always keep your settings to real C++ and things generally just work otherwise. :)
Logged

Penguin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 12
    • View Profile
Re: Exception on InputMgr Creation
« Reply #22 on: November 25, 2008, 09:36:20 AM »

Oddly, it now longer works. I've tried putting a working demo in place of my code, but still using my project and it compiled properly. I have disabled all the CLR and managed compiler/linker errors. Now if I put my code in the demo's project, it doesn't work. I've tested a few things and in the OIS::InputManager::createInputSystem() function, the 'im' variable contains all the correct values (I compared it with the variable of the working demo.) But when it gets returned, and I try to use it, the variable no longer contains all the correct variables. I've done all I can to try to figure it out, but can't.
« Last Edit: November 25, 2008, 10:09:30 AM by Penguin »
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Re: Exception on InputMgr Creation
« Reply #23 on: November 25, 2008, 08:55:39 PM »

You likely have messed up your stack when returning from the function. Check your code for null/invalid pointer usage.
Logged
Pages: 1 [2]