Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2005

Tip: Looking for answers? Try searching our database.

drag and drop issues (I'm using VS.NET 2005 beta 2)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lloyd Dupont - 27 Jul 2005 16:18 GMT
I started playing with Drag&Drop in my application.
I start dragging with code like that:

myControl.DoDragDrop(value, DragDropEffects.Copy);
where value is an instance of some business object.

When I drag my value around and move it over my controls or an other app
like Paint, everything behave allright.

However if I mouse over the FileExplorer or the TaskBar I got
COMException was unhandled with the message:
Invalid FORMATETC structure (Exception from HRESULT: 0x80040064
(DV_E_FORMATETC))

The stack trace doesn't cross my code at all!...
(below is a copy of the COMPLETE stack trace)
  at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo)
  at System.Windows.Forms.DataObject.GetDataIntoOleStructs(FORMATETC&
formatetc, STGMEDIUM& medium)
  at
System.Windows.Forms.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetDataHere(FORMATETC&
formatetc, STGMEDIUM& medium)
  at
System.Windows.Forms.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC&
formatetc, STGMEDIUM& medium)

As a side note, if I click OK/Continue, I have a few such errors in a row
(so multiple click on the OK button), and then the application continue
allright instead of dying.... (I have no top level cath & continue code).

Any ideas or tips?
Lloyd Dupont - 27 Jul 2005 16:43 GMT
Out of curiosity, even though my business object are in a data assembly
which is NOT normaly linked to System.Windows.Forms I, for the sake of the
test, linked with SWF, inherit SWF.DataObject and override

public override string[] GetFormats();
public override string[] GetFormats(bool b);

even after this change, I kept having the bug :-(
Oliver Sturm - 27 Jul 2005 19:25 GMT
> Out of curiosity, even though my business object are in a data assembly
> which is NOT normaly linked to System.Windows.Forms I, for the sake of the
[quoted text clipped - 4 lines]
>
> even after this change, I kept having the bug :-(

I've seen this as well, but I don't currently have an idea where it
comes from. So far I haven't bothered to debug it any further... IIRC,
the exception surfaces only if the app is running in the debugger, so it
seems to be caught somewhere.

               Oliver Sturm
Signature

omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619 http://www.sturmnet.org/blog


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.