KrasnovM / Gamma-Manager

Small app to adjust brightness and gamma ramp (gamma, brightness, contrast) on multiple monitors
Creative Commons Zero v1.0 Universal
15 stars 3 forks source link

Unhandled Exception #6

Closed thatoneguydan closed 1 year ago

thatoneguydan commented 1 year ago

Every time I try loading a config I get this message:

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Input string was not in a correct format.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.FormatException: Input string was not in a correct format. at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt) at Gamma_Manager.Window.comboBoxPresets_SelectedIndexChanged(Object sender, EventArgs e) at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e) at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m) at System.Windows.Forms.ComboBox.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

Gamma Manager Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Users/dan/Documents/Apps/Gamma%20Manager/Gamma.Manager.x64.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.8.9172.0 built by: NET481REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.8.9032.0 built by: NET481REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.8.9032.0 built by: NET481REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.8.9032.0 built by: NET481REL1 CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

** JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

KrasnovM commented 1 year ago

By loading a config you mean something wrong with App.config when you are trying to build a project or that means you are selecting a preset from drop-down list and then exception occurs?

thatoneguydan commented 1 year ago

Meaning whenever I save a preset, then try to select it from the drop-down list, I get this error. The preset doesn't load if I click continue in the error window.

KrasnovM commented 1 year ago

Might be empty spot somewhere in .ini file. That's how preset looks like in text form. image Can you open GammaManager.ini file that is created in same folder as .exe file? It should be readable by any text redactor, i use just a notepad. May be some lines are missing or no numbers in it.

thatoneguydan commented 1 year ago

GammaManager ini file.zip

This is the file. I also tried deleting it so that a new one would be created, but the problem persists.

[GSM7750: Default] monitor=GSM7750 rGamma=1.18 gGamma=1.18 bGamma=1.18 rContrast=1 gContrast=1 bContrast=1 rBright=0 gBright=0 bBright=0 monitorBrightness=100 monitorContrast=60

KrasnovM commented 1 year ago

For some reason it puts dots unstead of commas in decimals. May be this sequence of actions will help: Open .ini file, manually switch all dots to commas, save changes in .ini file, try to apply preset.

KrasnovM commented 1 year ago

I tried on my machine, when i switch commas to dots i get the same exception.

thatoneguydan commented 1 year ago

Manually switching the dots to commas fixes the problem. But when saving a new preset, it defaults to adding dots instead of commas, which makes the .ini file unreadable until manually correcting it.

Even if I delete the .ini file, the new file it creates still contains dots instead of commas.

KrasnovM commented 1 year ago

As i found, it depends on localization of system. Some of them convert digits to string with commas and some of them with dots. I will try to make it localization-independent.

KrasnovM commented 1 year ago

Release.zip There are three files for x86, x64, ARM64. Could you try the one that you need, push all buttons, move all sliders and all that? If it works i will put then in new release

thatoneguydan commented 1 year ago

I used the x64 version, everything works great!