473,816 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error trying to drag and drop between app instances (of same app)


I have a basic C# windows forms app where drag and drop of a simple class, no gui, from one tree to another (I store the class instance in the "tag" field of the tree nodes, and drag that) That is working fine within the same app instance. If I start two instances of the same app and try to drag from one app instance to the other, I get the below exception:

A first chance exception of type 'System.Runtime .Serialization. SerializationEx ception' occurred in system.windows. forms.dll

Additional information: The type System.Windows. Forms.DataObjec t in Assembly System.Windows. Forms, Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9 is not marked as serializable.

What I don't understand is that I am calling DoDragDrop on the tree view, but the object I am telling it to dnd is not windows forms derived, and it contains no windows forms reference.

treeView1.Selec tedNode = (TreeNode)e.Ite m;
MyObject objToDrag = (MyObject)((Tre eNode)e.Item).T ag;
treeView1.DoDra gDrop(objToDrag ,DragDropEffect s.Copy|DragDrop Effects.Move);

In the above example, MyObject is marked as Serializable, and I can successfully pass instances of it across a Web Service boundry.

Guessing this has something to do with the TreeView itself?

Thanks in advance!

Derrick
Nov 16 '05 #1
1 1465
think this was simply due to the fact that I was debugging one app instance, run both instances outside the IDE and works as expected!
"Derrick" <de*********@ex cite.com> wrote in message news:uk******** ******@TK2MSFTN GP14.phx.gbl...

I have a basic C# windows forms app where drag and drop of a simple class, no gui, from one tree to another (I store the class instance in the "tag" field of the tree nodes, and drag that) That is working fine within the same app instance. If I start two instances of the same app and try to drag from one app instance to the other, I get the below exception:

A first chance exception of type 'System.Runtime .Serialization. SerializationEx ception' occurred in system.windows. forms.dll

Additional information: The type System.Windows. Forms.DataObjec t in Assembly System.Windows. Forms, Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9 is not marked as serializable.

What I don't understand is that I am calling DoDragDrop on the tree view, but the object I am telling it to dnd is not windows forms derived, and it contains no windows forms reference.

treeView1.Selec tedNode = (TreeNode)e.Ite m;
MyObject objToDrag = (MyObject)((Tre eNode)e.Item).T ag;
treeView1.DoDra gDrop(objToDrag ,DragDropEffect s.Copy|DragDrop Effects.Move);

In the above example, MyObject is marked as Serializable, and I can successfully pass instances of it across a Web Service boundry.

Guessing this has something to do with the TreeView itself?

Thanks in advance!

Derrick
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1927
by: simon_s_li | last post by:
Hi, I am having problems using drag drop and re-ordering items. Example: When I drag and item from position 1 and drag it to position 3, I want to re-order all the items accordingly. This means an item in position 1 is now is position 3 and item 2 is now in postion 1 and item 3 is in position 2 and position 4 and 5 stay the same. I have searched the web.
2
4339
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put there? What about Drag/Drop; is there more than one way for the source to make data available Is it always OLE?
2
1419
by: Dante | last post by:
Has anyone ever successfully gotten a web deployed exe to have Drag Drop capabilities? I'm currently getting the message: An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll Additional information: DragDrop registration failed. Any help would be greatly appreciated.
4
2215
by: Qingdong Z. | last post by:
I have a VS.NET windows application which use drag-drop feather. It works fine when application start, but stops working after application run one or two days. The application is related to Video process, CPU/Memory extensive. The drag-drop is in a new windows form. It drags from TreeView Control to other control in the same form. It cannot trigger ItemDrag event of TreeView after drag-drop feather die. Can you give me any idea? Thanks.
0
926
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard: SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put there? What about Drag/Drop; is there more than one way for the source to make data available? Is it always OLE? What's the relationship between WM_DROPFILES and HDROP. I think HDROP is
5
10166
by: Brian Henry | last post by:
I haven't worked much with drag/drop but I am trying to make a form that accepts files to drug onto it from explorer and droped and have the form know the full path and file name of the files dropped onto it.. does anyone have any examples of this? thanks
1
5019
by: timnels | last post by:
I have created a muti-select treeview control. Problem is I am now trying to implement drag/drop in the application that uses it. It seems the mouse down and mouse move events fire before the OnBeforeSelect and OnAfterSelect events in the treeview. Since I want to start the drag/drop on the mouse move event, I have no clue that the current node has been selected yet. I tried moving all the code into the mouse down event (which actually...
1
1836
by: Nick | last post by:
Hi, I am developping an app using managed C++. I want to be able to do a drag drop from the app to windows explorer. The files to be dropped onto explorer do not exist yet, the files are to be created by the app when the user does the drop into explorer. I have done some searches and found COleDataSource::DelaySetData could be useful but this is MFC and I can't find the equivalent in .NET.
10
2337
by: Webbyz | last post by:
Hello, I was wondering if there is a way that I can enable my application to accept a file such as a .pdf that when dropped onto the document, it will upload the file to my database or a directory. I am trying to make the app as user friendly as possable and would just like the users to be able to drop the file into an area of the screen and it would just accept the document and maybe prompt if there is an existing file for that record...
0
9744
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10413
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10150
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9229
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7694
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6904
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5574
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3036
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.