PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?TmVpbCBXZXN0?=
Guest
Posts: n/a
 
      4th Aug 2005
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

 
Reply With Quote
 
 
 
 
JohnR
Guest
Posts: n/a
 
      16th Oct 2005
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" <(E-Mail Removed)> wrote in message
news:15CF92A7-21FB-4831-9A34-(E-Mail Removed)...
> 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
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop and Drag Cell Data TomD Microsoft Excel Programming 1 8th Mar 2010 03:02 AM
Drag and drop data only?? Chanda Microsoft Excel Misc 2 22nd Dec 2009 04:46 PM
Drag and Drop Column headers (drag and drop using wndProc?) KamiiKoneko@gmail.com Microsoft Dot NET Framework Forms 0 17th Dec 2007 02:28 PM
problem getting data from drag drop Tarscher Microsoft Dot NET Framework Forms 1 22nd Feb 2007 08:52 AM
Drag & Drop Contact Data =?Utf-8?B?VG9vVGFsbA==?= Microsoft Outlook Discussion 0 21st Oct 2004 03:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:05 AM.