DesktopGL crashing HELP

Hi again

I tried out the DesktopGL project and made simple game with it, but for some reason it crashes on my friends computer, why does it do that?
My error output says “External component has thrown an exception”,
OS is windows, computer has audio device, we have run oalinst.exe and installed .NET Framework 4.5 but it still crashes.

Why does it do that?

hmmm… I think we need to see the code that throws you this message.

And when/where it crashes…

Error seems to be related to audio, my friend doesn’t have sound / music in game, and when he tries to use an object that has multiple sound effects in the game it crashes.

Error output is based on sample I found online:

using System;
using System.Reflection;
using System.IO;

namespace MyGame
{
    public static class Program
    {
        [STAThread]
        static void Main()
        {
            try
            {
                using (var game = new Game1())
                    game.Run();
            }
            catch (Exception e)
            {
                var stackTrace = new System.Diagnostics.StackTrace(e, true);
                var frame = stackTrace.GetFrame(0);

                string[] outputString = new string[]{
                "Crash message: " + e.Message, 
                "Crash line: " + frame.GetFileLineNumber()+" in "+frame.GetFileName(),
                "Crash Time: "+DateTime.Now,
                };
                System.IO.File.WriteAllLines(@"Game_Crashed.txt", outputString);
            }
        }
    }
}`

Hmm… Where does that code actually play sound?

Anyway, I have had issues like this because of differing “cultural settings” on windows comps… (Although -notice- I dont remember any actual error messages from those events)

if you save/load a float value from a txt file (like user menu settings and volume), whether ‘.’ or ‘,’ is counted as a decimal marker is up to the users windows settings…

You have to actually over-load the string reader to be culture invariant…

Otherwise your intended decimal point is skipped, and you end up with bad values, beyond the limit of 1.0f, which is 100%… Causes crashes!

If in doubt, you could try force-setting volume to 0, or comment out sound playback, and see if that runs… Narrow it down some, maybe…

The crash was related to Audio Hardware after all.
My friend plugged headset in a jack instead of USB sound card and it is working now.

1 Like