Search found 11132 matches

by jvierra
Thu Aug 17, 2017 11:00 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 238

Re: GUI Has stopped Working [Powershell Studio]

This looks like the Try/Catch is reentered somewhere. Do you have other try/catch blocks? at System.Management.Automation.Interpreter. EnterTryCatchFinallyInstruction .Run(System.Management.Automation.Interpreter.InterpretedFrame) at System.Management.Automation.Interpreter. EnterTryCatchFinallyInst...
by jvierra
Thu Aug 17, 2017 10:57 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 238

Re: GUI Has stopped Working [Powershell Studio]

This is the curious error:

Exception Info: System.AccessViolationException
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)
by jvierra
Thu Aug 17, 2017 10:42 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 238

Re: GUI Has stopped Working [Powershell Studio]

The following construct would be much more efficient. $timer1_Tick = { $timer.Stop() try { if ($line = $script:Job.ChildJobs[0].Verbose.ReadAll()) { $RTB_Output.Lines += $line } if ($line = $script:Job.ChildJobs[0].Output.ReadAll()) { $RTB_Output.Lines += $line } if ($line = $script:Job.ChildJobs[0]...
by jvierra
Thu Aug 17, 2017 10:34 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 238

Re: GUI Has stopped Working [Powershell Studio]

The following method is more efficient.

Code: Select all

#Append output streams to $RTB_Output w/ new line 
$RTB_Output.Lines += $debugStream
$RTB_Output.Lines += $verboseStream
$RTB_Output.Lines += $outputStream
$RTB_Output.Lines += $errorStream
$RTB_Output.Lines += $warningStream
by jvierra
Thu Aug 17, 2017 10:30 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 238

Re: GUI Has stopped Working [Powershell Studio]

No. Stopping the timer should do it. 1000 ms should not give you this issue but it is BP to kill the timer except when you want high resolution ticks. Stopping and starting skews the tick interval slightly.
by jvierra
Thu Aug 17, 2017 9:44 am
Forum: PowerShell GUIs
Topic: GUI Has stopped Working [Powershell Studio]
Replies: 28
Views: 238

Re: GUI Has stopped Working [Powershell Studio]

Stop the timer when entering the code and restart it when leaving. The exception looks like you are ticking in the Catch{} which can cause a race condition and repeated nested exceptions.
by jvierra
Thu Aug 17, 2017 7:46 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 162

Re: access group box from another form

Here is an example of how to send to a child:
by jvierra
Thu Aug 17, 2017 7:41 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 162

Re: access group box from another form

The sample is just two blank forms. It does not tell us what you are trying to do. hen a form calls a form the "calling" form is frozen until the "called" form is closed. THis is because the child is opened as a modal dialog. This is how PowerShell works. You cannot execute code in the parent form w...
by jvierra
Thu Aug 17, 2017 6:53 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 162

Re: access group box from another form

No idea how you are doing this. The main form cannot execute code while child form is running. You will need to post a simple example of your form.
by jvierra
Thu Aug 17, 2017 4:26 am
Forum: PowerShell GUIs
Topic: access group box from another form
Replies: 10
Views: 162

Re: access group box from another form

Hi woody - it is not possible to understand what you are trying to do. Please provide a more complete explanation. Note that yu cannot type or access a form while it has a child form showing.