PC Review


Reply
Thread Tools Rate Thread

clipboard and a file

 
 
Marco Osvaldo
Guest
Posts: n/a
 
      4th Jan 2005
Hi to all, I would like to be able to copy & paste a file.
I think the file type in WinXP is the DataFormats.FileDrop. So I have an
object
....
IDataObject myObject = (IDataObject) ido.GetData(DataFormats.FileDrop);
....
but I receive this error:

"An unhandled exception of type 'System.InvalidCastException' occurred in
WindowsApplication1.exe
Additional information: Specified cast is not valid."

Any ideas?


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      4th Jan 2005
Marco,

If you assign the result of "ido.GetData(DataFormats.FileDrop)" to an
object, and look at it in the debugger, you should see the type of the
object that is returned.

ido is the IDataObject implementation though, the object returned will
not implement it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Marco Osvaldo" <(E-Mail Removed)> wrote in message
news:41da87f7$0$8202$(E-Mail Removed)...
> Hi to all, I would like to be able to copy & paste a file.
> I think the file type in WinXP is the DataFormats.FileDrop. So I have an
> object
> ...
> IDataObject myObject = (IDataObject) ido.GetData(DataFormats.FileDrop);
> ...
> but I receive this error:
>
> "An unhandled exception of type 'System.InvalidCastException' occurred in
> WindowsApplication1.exe
> Additional information: Specified cast is not valid."
>
> Any ideas?
>
>



 
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
clipboard to file app Walter_Slipperman Windows Vista General Discussion 4 31st Dec 2008 04:27 PM
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? tskogstrom Microsoft Excel Programming 2 6th Mar 2007 12:50 PM
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
File from Clipboard Al Microsoft VB .NET 1 9th Aug 2006 05:38 PM
Where is the clipboard CLP file stored? David Peters Windows XP General 9 9th Mar 2006 12:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:58 PM.