473,386 Members | 1,720 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,386 software developers and data experts.

C# Clipboard with Reflection question

I have an item that I placed on the clipboard as follows:
Clipboard.SetDataObject(slide);
slide is type SlideType.

Now I'm trying to read the data from the clipboard doing:

foreach (System.Type type in this.slideModules.Values)
{
if (Clipboard.GetDataObject().GetDataPresent(type))
{
Clipboard.GetDataObject().GetData(type);
break;
}
}

However, on the GetData() line, I receive a FileNotFoundException
claiming that SlideType was not found. I suspect the issue is that
SlideType is actually loaded via reflection (it's in a dll I'm loading
at runtime). Is there anyway to get the clipboard to work with types
loaded through reflection?

May 19 '06 #1
5 1778
It depends on the the type of the object in the clipboard, If the object
cannot be represented with one of the standard clipboard formats the object
is serialized. In order to be deserialized on the reading side the consumer
of this object has to know this type.
--

Stoitcho Goutsev (100)

<dm*****@gmail.com> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
I have an item that I placed on the clipboard as follows:
Clipboard.SetDataObject(slide);
slide is type SlideType.

Now I'm trying to read the data from the clipboard doing:

foreach (System.Type type in this.slideModules.Values)
{
if (Clipboard.GetDataObject().GetDataPresent(type))
{
Clipboard.GetDataObject().GetData(type);
break;
}
}

However, on the GetData() line, I receive a FileNotFoundException
claiming that SlideType was not found. I suspect the issue is that
SlideType is actually loaded via reflection (it's in a dll I'm loading
at runtime). Is there anyway to get the clipboard to work with types
loaded through reflection?

May 19 '06 #2
Yeah, it will need to be deserialized. The object is marked as
Serializable. Is there anyway I can provide the "consumer" with the
information it needs to deserialize it?

Thanks for the help.

May 19 '06 #3
The client application needs to reference a dll with declaration of the
type.

--

Stoitcho Goutsev (100)

<dm*****@gmail.com> wrote in message
news:11**********************@j73g2000cwa.googlegr oups.com...
Yeah, it will need to be deserialized. The object is marked as
Serializable. Is there anyway I can provide the "consumer" with the
information it needs to deserialize it?

Thanks for the help.

May 19 '06 #4
Well the client app handling the paste is the one that executed the
copy. So if it has the information such that it can put the object on
the clipboard (serialize it) shouldn't it have enough information to
take it off (deserialize it)? Or am I missing something?

May 19 '06 #5
Yes, it should.
Can you post some simple compilable sample that demonstratest the porblem?
--

Stoitcho Goutsev (100)

<dm*****@gmail.com> wrote in message
news:11**********************@j55g2000cwa.googlegr oups.com...
Well the client app handling the paste is the one that executed the
copy. So if it has the information such that it can put the object on
the clipboard (serialize it) shouldn't it have enough information to
take it off (deserialize it)? Or am I missing something?

May 19 '06 #6

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

Similar topics

0
by: xyz | last post by:
I have a menu item to handle clipboard actions (cut, copy, paste). When I paste text that I copied from a Hungarian web page, the display looks normal on my RichTextBox, but the text retrieved from...
8
by: LG | last post by:
Just have a question with regards to the clipboard, and how to read what other applications (Adobe InDesignCS) place in the clipboard. I am currently in the process of creating a booklet from a...
2
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
0
by: Christopher | last post by:
Hello, First, I appologize for the length but I want to get all the facts down so as not to waste any time :) I'm trying to allow the user of my C# app to copy a DataGrid full of double values...
9
by: Tim Frawley | last post by:
I have converted a VB6 application to VB.NET. The old application made extensive use of the Clipboard for copying an Image Name so that it could be pasted into the image capture app when the user...
4
by: JohnR | last post by:
Hi all, I'm finally sick and tired of manually generating get/set properties for each private variable in a class so I'm trying to create a macro to do it. I'm stuck because I can't figure out...
0
by: James Russo | last post by:
Hello, I have an application which requires an image to be retrived from the clipboard. So, I am writting a quick C# windows application to take images from a webcam and store a single frame on...
0
by: jen | last post by:
this works fine it i operate on one .doc file; however, if i process multiple files, i get the following error: Requested Clipboard operation did not succeed. i suspect i need to clear my...
7
by: Newbie | last post by:
How do I clear the clipboard in VB.NET 2003? TIA Newbie
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.