Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Clipboard Crash (Read 4721 times)
jmquinlan
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 67
Joined: Apr 2nd, 2009
Clipboard Crash
Apr 27th, 2009 at 2:40pm
Print Post  
Hello,

I'm getting the following crash when I have programmatically created some nodes and want to copy the selected items to the clipboard.

Code
Select All
System.ArgumentNullException was unhandled
  Message="Value cannot be null.\r\nParameter name: value"
  Source="mscorlib"
  ParamName="value"
  StackTrace:
	 at System.Collections.CollectionBase.OnValidate(Object value)
	 at System.Collections.CollectionBase.System.Collections.IList.set_Item(Int32 index, Object value)
	 at MindFusion.Diagramming.DiagramItemCollection.set_Item(Int32 index, DiagramItem value)
	 at MindFusion.Diagramming.Diagram.CopySelection(Diagram source, Boolean unconnectedLinks, Boolean copyGroups)
	 at MindFusion.Diagramming.WinForms.DiagramView.xd387e793db5b6581(Boolean x14d6ee1d6b77a32d, Boolean xf7b2c9839607605d)
	 at MindFusion.Diagramming.WinForms.DiagramView.CopyToClipboard(Boolean persist, Boolean groups)
	 at MindFusion.Diagramming.WinForms.DiagramView.CopyToClipboard(Boolean persist)
	 at AnimationSequencer.AnimationSequencer.copyToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Perforce\f1branches\dev\dev1\programming\tools\game\AnimationSequencer\AnimationSequencer.cs:line 1299
	 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
	 at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
	 at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
	 at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
	 at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
	 at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
	 at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
	 at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
	 at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
	 at System.Windows.Forms.Control.WndProc(Message& m)
	 at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
	 at System.Windows.Forms.ToolStrip.WndProc(Message& m)
	 at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
	 at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
	 at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
	 at System.Windows.Forms.NativeWindow.DebuggableCallback(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(Int32 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 AnimationSequencer.Program.Main() in C:\Perforce\f1branches\dev\dev1\programming\tools\game\AnimationSequencer\Program.cs:line 17
	 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
	 at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
	 at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
	 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
	 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
	 at System.Threading.ThreadHelper.ThreadStart()
 




the code i'm using to copy to the clipboard is:

Code
Select All
m_diagramView.CopyToClipboard(false);
 



is there any other initialisation I need to do that I'm missing to allow clipboard functionality to work.

also Im using custom node types.
  
Back to top
 
IP Logged
 
jmquinlan
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 67
Joined: Apr 2nd, 2009
Re: Clipboard Crash
Reply #1 - Apr 27th, 2009 at 2:40pm
Print Post  
also there is definitly an item selected in the diagram.

  
Back to top
 
IP Logged
 
jmquinlan
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 67
Joined: Apr 2nd, 2009
Re: Clipboard Crash
Reply #2 - Apr 27th, 2009 at 2:45pm
Print Post  
actually ignore me i just found out that your clipboard function does not work with custom node types without defining a copy constructor

okay that fine but having the system crash when this is done is pretty bad, a nice warning or message box would be more appropriate.

  
Back to top
 
IP Logged
 
jmquinlan
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 67
Joined: Apr 2nd, 2009
Re: Clipboard Crash
Reply #3 - Apr 27th, 2009 at 3:13pm
Print Post  
ah now I've created a copy constructor which is definitly getting called yet it still failes to paste,

the PasteFromClipboard function returns false.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Clipboard Crash
Reply #4 - Apr 27th, 2009 at 3:18pm
Print Post  
Have you also implemented binary serialization methods for your custom types?
  
Back to top
 
IP Logged
 
jmquinlan
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 67
Joined: Apr 2nd, 2009
Re: Clipboard Crash
Reply #5 - Apr 27th, 2009 at 3:36pm
Print Post  
nope, would you happen to have a decent example of what it is that needs to be done?

regards
  
Back to top
 
IP Logged
 
jmquinlan
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 67
Joined: Apr 2nd, 2009
Re: Clipboard Crash
Reply #6 - Apr 28th, 2009 at 10:00am
Print Post  
Its okay I've implemented my own xml serialisation for the copy paste which works really well. cheers
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint