Repository navigation
Open
Description
I use AnyBox to create dialog windows for my PS script. Although a number of different windows might be used, every time the script runs this large dialog is shown.
On occasion I get an Unhandled Windows Exception Error like this
Unhandled exception. System.ComponentModel.Win32Exception (1816): Not enough quota is available to process this command.
at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
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)
ChatGPT analysis seems spot on (a small part of a much longer session).
The full error message you've provided offers more context and helps narrow down the possible causes of the "Not enough quota is available to process this command" error. This error is thrown from within the Windows Presentation Foundation (WPF) infrastructure, as indicated by the stack trace involving classes like HwndTarget, HwndSource, and the WPF Dispatcher. This suggests that the issue is related to the graphical user interface (GUI) components of your application or script, which aligns with the suspicion around AnyBox or any other part of your script that creates or manipulates windows or other GUI elements.
Since the rest of the script deals with handing files to ImageMagick for conversion, the error most likely comes from AnyBox, perhaps by not properly releasing resources?
Metadata
Metadata
Assignees
Labels
No labels

Activity
fresh2dev commentedon Dec 9, 2024
I've never encountered this issue, and I have several AnyBox apps that run indefinitely.
Maybe it's the ImageMagick image conversion that's eating up RAM?
🤷
[-]Probable AnyBox resource leak [/-][+]Exception hints at resource leak [/+]PowerPCFan commentedon Dec 16, 2024
@tgill880 This might be random, but would you mind sharing just the AnyBox part of the code? I want something similar to this for a project I'm doing
tgill880 commentedon Dec 16, 2024
@PowerPCFan Sure. But where and how?
@fresh2dev Could I do a pull request and submit my code as an example?
PowerPCFan commentedon Dec 16, 2024
@tgill880 you can reply with the code on this issue as long as you don’t run into a character limit, whatever works - or make a fork/pull request
I also have an email on my GitHub profile if that's easier lol
fresh2dev commentedon Dec 16, 2024
Preferrably, throw it in a GitHub Gist.
PowerPCFan commentedon Dec 27, 2024
@fresh2dev I should probably open my own issue for this, but how do I do things like the file path selector, dropdowns, checkboxes, radio buttons, etc? I've only figured out the anybox basics and unless I'm missing something I couldn't really find a good explanation in the docs