Jump to content
  • Advertisement
Sign in to follow this  

Throwing Exception in a component gives Invalid Call?

This topic is 2805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I have done research on this Invalid-Call-problem quite long, but somehow the answers seem to confuse me since there are really astoundingly many ways of what can cause this specific exception.

First my problem:
1. I have a Game class that does the Update/Draw-Stuff, which is similiar to the SlimdX-Sample Game class from the Feb2010 SDK.
2. I have a MenuSystem, which - at initialize - loads in the menu and layout files
3. When loading a layout, some entries are allowed to throw a dedicated exception (CLayoutException) which is immediately caught by the Menu System (so the exception won't go higher in the hierarchy).
--> When this exception is caught, what follows is an immediate STOP, caused by the call made to "SlimDX.[...].Device.BeginScene()".
But, if the exception under (3.) is NOT being caused, everything runs just fine.

I mean of course, in general it is good to NOT have exceptions, but I don't want to put a try-catch with an empty catch-block around everything, that is bad design in my opinion :/
Especially when the layout file from above is modifyable by the user and the user can also enter wrong, unexpected and flawed information which is read by the component.

I'm really into this problem for 3 hours straight and I can't come up with a cure...
What you may need to know is, that everything is on the same Thread, so there is no concurring access at this stage (game initialization phase).

Any ideas? I'd be thankful for each bit of help! :)

Best regards,

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!