473,394 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do I extract my data from a Drag & Drop ComObject?

I’m trying to drag & drop listview items between two instances of my app. The
actual data that’s passed in DoDragDrop is an arraylist that’s been
serialized to a memorystream. The contents of the arraylist are objects of a
simple, serializable custom class that allows the recipient listview to
reconstruct the dragged listitems. (the contents of the arraylist actually
don’t matter…they can be simple integers and the issues in this post remain
the same)

When I’m dragging & dropping within an instance of my app, e.Data from the
DragDrop event is a DataObject and I can extract my memorystream, deserialize
it, and I’m good. However, when I drag & drop to another instance of my
application, e.Data is a System.__ComObject. Attempting to extract my data
with the normal e.Data.GetData method results in a memorystream that’s,
according to the Locals window, a
System.Runtime.Remoting.Proxies.__TransparentProxy , which is beyond the scope
of my VB knowledge. Regardless, it doesn’t deserialize, and now I’m stuck.

So could someone kindly explain what I need to do to the __ComObject to get
my memorystream out? Here’s my code:

If e.Data.GetDataPresent("System.IO.MemoryStream") Then
Dim Formatter As New BinaryFormatter
Dim Stream As New System.IO.MemoryStream
Dim DropList As New ArrayList

Stream = e.Data.GetData("System.IO.MemoryStream")
Stream.Position = 0
DropList = Formatter.Deserialize(Stream)
Any help would be appreciated.

Neil

Nov 21 '05 #1
1 2222
Hi Neil,

I am having the exact same problem and was disappointed to see that
nobody replied... Did you find a solution that you could share?

John

"Neil West" <Ne******@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...
I'm trying to drag & drop listview items between two instances of my app.
The
actual data that's passed in DoDragDrop is an arraylist that's been
serialized to a memorystream. The contents of the arraylist are objects
of a
simple, serializable custom class that allows the recipient listview to
reconstruct the dragged listitems. (the contents of the arraylist
actually
don't matter.they can be simple integers and the issues in this post
remain
the same)

When I'm dragging & dropping within an instance of my app, e.Data from the
DragDrop event is a DataObject and I can extract my memorystream,
deserialize
it, and I'm good. However, when I drag & drop to another instance of my
application, e.Data is a System.__ComObject. Attempting to extract my
data
with the normal e.Data.GetData method results in a memorystream that's,
according to the Locals window, a
System.Runtime.Remoting.Proxies.__TransparentProxy , which is beyond the
scope
of my VB knowledge. Regardless, it doesn't deserialize, and now I'm
stuck.

So could someone kindly explain what I need to do to the __ComObject to
get
my memorystream out? Here's my code:

If e.Data.GetDataPresent("System.IO.MemoryStream") Then
Dim Formatter As New BinaryFormatter
Dim Stream As New System.IO.MemoryStream
Dim DropList As New ArrayList

Stream = e.Data.GetData("System.IO.MemoryStream")
Stream.Position = 0
DropList = Formatter.Deserialize(Stream)
Any help would be appreciated.

Neil

Nov 21 '05 #2

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

Similar topics

0
by: Plumer | last post by:
Hello everyone, Yesterday I posted a message about implementing drag & drop in a TreeView control. I'm having real difficulty getting this to work -- the process seems to be incredibly...
2
by: Grey | last post by:
I need to design a workflow application with C#. I want to design an UI with some workflow components which they can be drag & drop anywhere in order to design the workflow for the application...
2
by: Ivo Tcholakov | last post by:
Is it possible to drag and drop controls in an aspx page at runtime ? Meaning i have developed a ASP.NET web form, the web form is now downloaded in IE - now can i have this form to detect mouse...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
3
by: Goldwind | last post by:
Hi, I"m trying to use drag & drop of text from one text box to another but without suceess. Microsoft presented an example in "101 code samples" BUT in this example the code select and drag all...
3
by: Uma sakshi | last post by:
Hi I have one VB.NET application,in that application i have one datagrid control.The datagrid control contains somedata.I want to copy the data in a particular cell and paste it into my C#.NET...
5
by: sesar | last post by:
How can I impement drag&drop for simple 'dialog base' application... I want to drag&drop txt file and load the text to variable
1
by: SteveDouglas | last post by:
Hi all, I am currently writing an application in VB.NET that has a lot of controls (treeviews/listviews/labels and so forth) that represent "things" that need to be draggable from place to place,...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.