Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updater Progress bar crash with Classic Visual Theme #194

Closed
Belphemur opened this issue May 31, 2017 · 10 comments
Closed

Updater Progress bar crash with Classic Visual Theme #194

Belphemur opened this issue May 31, 2017 · 10 comments
Assignees
Labels
Bug Issues which are bug reports Confirmed Confirmed issues

Comments

@Belphemur
Copy link
Owner

SoundSwitch-crashlog-31_5_2017.zip

Message: Visual Styles-related operation resulted in an error because no visual style is currently active.
Source: System.Windows.Forms
StackTrace:
   at System.Windows.Forms.VisualStyles.VisualStyleRenderer.IsCombinationDefined(String className, Int32 part)
   at System.Windows.Forms.VisualStyles.VisualStyleRenderer..ctor(String className, Int32 part, Int32 state)
   at System.Windows.Forms.ProgressBarRenderer.InitializeRenderer(VisualStyleElement element)
   at System.Windows.Forms.ProgressBarRenderer.DrawHorizontalBar(Graphics g, Rectangle bounds)
   at SoundSwitch.UI.UserControls.TextProgressBar.OnPaint(PaintEventArgs e) in D:\VS\SoundSwitch\SoundSwitch.UI.UserControls\TextProgressBar.cs:line 48
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
@Belphemur Belphemur added Bug Issues which are bug reports Confirmed Confirmed issues labels May 31, 2017
@FireEmerald
Copy link
Contributor

FireEmerald commented May 31, 2017

At least a description about this crash would be helpful.
SoundSwitch Version?
When does it occur?
How to reproduce?
...

@Belphemur
Copy link
Owner Author

Sorry, done it fast this morning.

It's linked to using the Classic Theme on Windows 7.
The updater window crash (the progress bar on it to be exact). I had that problem before with another form.

The problem is linked directly with the fact there is no visual style when the classic mode is activated:

https://msdn.microsoft.com/en-us/library/system.windows.forms.progressbarrenderer(v=vs.110).aspx

The fix would be to check IsSupported: https://msdn.microsoft.com/en-us/library/system.windows.forms.progressbarrenderer.issupported%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

In the case it's not supported, just update the text and not the progress bar.

@Belphemur Belphemur changed the title Updater Progress bar crash Updater Progress bar crash with Classic Visual Theme May 31, 2017
@FireEmerald
Copy link
Contributor

The problem can't occur on Windows 10 Anniversary Update due to the fact that it seems like they removed the classic theme - i will need a virtual machine to reproduce this crash.

@Belphemur
Copy link
Owner Author

What annoys me is to know how old this issue really is ... But well, I should have checked the documentation before using this progress bar.

I added this progress bar in the beginning of the version 3.x.

@FireEmerald
Copy link
Contributor

2017-05-31 16_26_11
Think the worse bug is the exception handling at this place.

@Belphemur
Copy link
Owner Author

Belphemur commented May 31, 2017 via email

@FireEmerald
Copy link
Contributor

Is there anything special when compiling SoundSwitch for older WinVersions, like Win7? I only get a APPCRASH after starting the *.exe if i use my compiled version.

I thought it would be enought to install the Visual C++ 2015 Build Tools.

@Belphemur
Copy link
Owner Author

Use the Make.bat to build the project. It will generate everything correctly.

It's easier to use the installer on the VM to try it out.

@FireEmerald
Copy link
Contributor

FireEmerald commented May 31, 2017

Fixed in aa48697.
2017-05-31 17_59_19

@Belphemur
Copy link
Owner Author

Can you do a pull request on dev ?

In the message put "Fixes #194", I'll merge it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues which are bug reports Confirmed Confirmed issues
Projects
None yet
Development

No branches or pull requests

2 participants