I was playing around with my trigger plugins (a new one - Serial), and I sent off 2 sequences at the same time (both on adjustable preview). It appears that there's an assumption (which I would make) that only 1 thread will be used. But when multiple sequences are running, it dies with the error below.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
*********** Exception Text ********
System.ArgumentException: Controls created on one thread cannot be parented to a control on a different thread.
Parameter name: value
at System.Windows.Forms.Form.set_MdiParentInternal(Form value)
at System.Windows.Forms.Form.set_MdiParent(Form value)
at Vixen.Host.ParentPlugInDialog(Form form)
******** Loaded Assemblies ********
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Vixen
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Vixen.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
AppUpdate
Assembly Version: 2.0.0.16
Win32 Version: 2.0.0.16
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AppUpdate.DLL
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
fmod
Assembly Version: 2.0.0.10
Win32 Version: 2.0.0.10
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/fmod.DLL
----------------------------------------
CometConversion
Assembly Version: 2.0.0.11
Win32 Version: 2.0.0.11
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/CometConversion.DLL
----------------------------------------
DMXAddIn
Assembly Version: 2.0.0.11
Win32 Version: 2.0.0.11
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/DMXAddIn.DLL
----------------------------------------
MIDIReader
Assembly Version: 2.0.0.11
Win32 Version: 2.0.0.11
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/MIDIReader.DLL
----------------------------------------
RemoteClient
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/RemoteClient.DLL
----------------------------------------
RGBLEDAddIn
Assembly Version: 2.0.0.11
Win32 Version: 2.0.0.11
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/RGBLEDAddIn.DLL
----------------------------------------
Spectrum
Assembly Version: 2.0.0.11
Win32 Version: 2.0.0.11
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/Spectrum.DLL
----------------------------------------
WattMeter
Assembly Version: 2.0.0.11
Win32 Version: 2.0.0.11
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/WattMeter.DLL
----------------------------------------
Waveform
Assembly Version: 2.0.0.13
Win32 Version: 2.0.0.13
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/AddIns/Waveform.DLL
----------------------------------------
IDMX
Assembly Version: 2.0.0.0
Win32 Version: 2.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/Output/IDMX.DLL
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
8_Line595
Assembly Version: 2.0.0.14
Win32 Version: 2.0.0.14
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/Output/8_Line595.DLL
----------------------------------------
AdjustablePreview
Assembly Version: 2.0.0.14
Win32 Version: 2.0.0.14
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/Output/AdjustablePreview.DLL
----------------------------------------
NetworkTrigger
Assembly Version: 1.0.2741.29389
Win32 Version: 1.0.2741.29389
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/Trigger/NetworkTrigger.DLL
----------------------------------------
ParallelTrigger
Assembly Version: 1.0.2741.22625
Win32 Version: 1.0.2741.22625
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/Trigger/ParallelTrigger.DLL
----------------------------------------
SerialTrigger
Assembly Version: 1.0.2750.18806
Win32 Version: 1.0.2750.18806
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/Trigger/SerialTrigger.DLL
----------------------------------------
FrameGenerator
Assembly Version: 2.0.0.15
Win32 Version: 2.0.0.15
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/UI/FrameGenerator.DLL
----------------------------------------
Frames
Assembly Version: 2.0.0.15
Win32 Version: 2.0.0.15
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/UI/Frames.DLL
----------------------------------------
LedTriksUI
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/UI/LedTriksUI.DLL
----------------------------------------
StandardScript
Assembly Version: 2.0.0.15
Win32 Version: 2.0.0.15
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/UI/StandardScript.DLL
----------------------------------------
ScriptEngine
Assembly Version: 2.0.0.15
Win32 Version: 2.0.0.15
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/ScriptEngine.DLL
----------------------------------------
StandardSequence
Assembly Version: 2.0.1.0
Win32 Version: 2.0.1.0
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/UI/StandardSequence.DLL
----------------------------------------
TriggerResponse
Assembly Version: 2.0.0.15
Win32 Version: 2.0.0.15
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/Plugins/UI/TriggerResponse.DLL
----------------------------------------
ICSharpCode.SharpZipLib
Assembly Version: 0.85.1.271
Win32 Version: 0.85.1.271
CodeBase: file:///C:/Documents%20and%20Settings/p90/My%20Documents/Vixen%202.0/ICSharpCode.SharpZipLib.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.
Let me know if you're able to reproduce this after the next release. I can't reproduce it using multiple trigger responses with previews, but I also didn't do anything to explicitly address this.
Another thought, which should have been my first thought...does your plugin make use of multiple threads?
If the plugin has a GUI form you will need to using invoke to make sure that the thread that is running can be exposed to your GUI objects you wish to update.
I think I said that right.
Smacks self on head for not realising it.
It uses System.Threading for running a parallel 'watching' thread. So, unfortunately, you've probably got a cross-thread issue.
I had one of them in one of my other projects - the only problem being that I never really worked out how Invoke worked - I understood the theory, but couldn't get the code right.
flowblok
At least it's something that easily addressable. I can imagine many trigger plugins will use some sort of polling thread in combination with an output plugin to test the output, so this is a necessary change. Thanks.
Flowblok - I implemented a change that works with my tests. Let me know if it addresses your problem when the update goes out (no earlier than this weekend).
flowblok wrote:
I had one of them in one of my other projects - the only problem being that I never really worked out how Invoke worked - I understood the theory, but couldn't get the code right.flowblok
Here is some sample code from one of my projects that may help you.
public class Class1
{
delegate void VduMessageHandlerDelegate(object obj, XmlDocument doc);
public Class1()
{
}
private void VduMessageHandler(object obj, XmlDocument doc)
{
if (InvokeRequired)
{
VduMessageHandlerDelegate vduMessages =
new VduMessageHandlerDelegate(VduMessageHandler);
Invoke(vduMessages, new object[] { obj, doc });
return;
}
//execute some code here since you are now on the right thread
}
}
Or you could BeginInvoke() so that you're not blocking while waiting for the UI thread to complete the call (unless you need to). If you Invoke() and the UI thread is waiting for something else to complete (such as your worker thread), you could be in some trouble.
I use them both depends on what I need to do.
