PowerVision 2.9.20040 Windows Scaling

Hamsteh
Posts: 42
Joined: Wed Sep 21, 2011 3:31 am

PowerVision 2.9.20040 Windows Scaling

Post by Hamsteh » Mon Sep 18, 2017 12:39 pm

Powervision looks pretty shabby with 125-150% desktop scaling in Windows 10, but if you disable the windows scaling in 2.8 it ends up looking quite good.
https://imgur.com/a/g4EOM


Trying to do this in PowerVision 2.9 however, causes a crash to desktop upon opening a config.

Code: Select all

Error Message:

   Exception has been thrown by the target of an invocation.

PowerVision Studio Version:

   2.9.20040

Environment:

   Microsoft Windows NT 6.2.9200.0    Is64Bit: True

Error Location:

   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at PowerVision.WindowsClient.DeviceInformation.ConfigurationPanelSelectionUI.BuildUserInterface()
   at PowerVision.WindowsClient.DeviceInformation.ConfigurationPanelSelectionUI.OnInitialize()
   at PowerVision.WindowsClient.Framework.BaseControl.Initialize()
   at PowerVision.WindowsClient.Framework.MainForm.BackgroundWorker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)
   at System.ComponentModel.RunWorkerCompletedEventHandler.Invoke(Object sender, RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at PowerVision.Executable.Color.Program.Main()
www.ajbarry.com.au Bespoke Control Systems
BEng (Robotics and Mechatronics) & BSci (Computer Software Engineering)
Melbourne, Australia
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: PowerVision 2.9.20040 Windows Scaling

Post by boyce » Fri Sep 22, 2017 11:20 am

PowerVision has been around for a long time and a lot of the code was written using Windows Forms which do not scale very good. Some parts of the user interface have been rewritten using WPF and it does scale very good. Over time all of PowerVision will be replaced with new code because of this problem. Sorry for the inconvenience and please understand that it is a very big job to complete this upgrade.
Boyce Schrack
Enovation Controls
Hamsteh
Posts: 42
Joined: Wed Sep 21, 2011 3:31 am

Re: PowerVision 2.9.20040 Windows Scaling

Post by Hamsteh » Fri Sep 22, 2017 11:23 am

Hi Boyce, thanks kindly for the reply.
Half of the applications on my PC scale poorly so no surprises there, and completely understand it's a big ask.
I do wonder if there is any knowledge as to why 2.9 crashes when scaling is disabled and 2.8 does not though?

Kind Regards,
Alex
www.ajbarry.com.au Bespoke Control Systems
BEng (Robotics and Mechatronics) & BSci (Computer Software Engineering)
Melbourne, Australia
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: PowerVision 2.9.20040 Windows Scaling

Post by boyce » Fri Sep 22, 2017 1:04 pm

Would you be able to send me the configuration in a Private Message so that I can reproduce the crash?
Boyce Schrack
Enovation Controls
Hamsteh
Posts: 42
Joined: Wed Sep 21, 2011 3:31 am

Re: PowerVision 2.9.20040 Windows Scaling

Post by Hamsteh » Fri Sep 22, 2017 1:07 pm

Hi Boyce, It's no particular config - it does it with the templates also.
www.ajbarry.com.au Bespoke Control Systems
BEng (Robotics and Mechatronics) & BSci (Computer Software Engineering)
Melbourne, Australia
boyce
Enovation Controls Development
Enovation Controls Development
Posts: 322
Joined: Wed Sep 08, 2010 5:09 pm

Re: PowerVision 2.9.20040 Windows Scaling

Post by boyce » Fri Sep 22, 2017 1:43 pm

Ok, yes, I have not seen that before. I talked to the developers and they said not to use the Compatibility - Disable display scaling on high DPI settings that it will now break PowerVision 2.9. PowerVision 2.9 now supports the high DPI settings and it requires it and it now works just fine without being disabled.
Boyce Schrack
Enovation Controls