clipboard and a file

M

Marco Osvaldo

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?
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top