473,399 Members | 3,919 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,399 software developers and data experts.

User defined Object in Clipboard

I'm having problem pasting a user defined object that's put into the
clipboard....

Here's a crude example of what I'm trying to get done.

Dim fromShapes as Shapes 'shapes is my custom object
Dim toShapes as Shapes
Clipboard.SetDataObject(fromShapes) ' this works...I can see in
clipboard.exe that it has changed

Dim iData as IDataObject = Clipboard.GetDataObject
toShapes = iData.GetData("NOT SURE WHAT TO PUT HERE")

Thanks.
Nov 21 '05 #1
5 1551
You should use:

toShapes = iData.GetData(toShapes.GetType)

Hope this helps,
Brian Swanson

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:RT*********@DONTwalchemSPAM.com:
I'm having problem pasting a user defined object that's put into the
clipboard....

Here's a crude example of what I'm trying to get done.

Dim fromShapes as Shapes 'shapes is my custom object
Dim toShapes as Shapes
Clipboard.SetDataObject(fromShapes) ' this works...I can see in
clipboard.exe that it has changed

Dim iData as IDataObject = Clipboard.GetDataObject
toShapes = iData.GetData("NOT SURE WHAT TO PUT HERE")

Thanks.


Nov 21 '05 #2
That always returns 'nothing'.

If I view the GetType in a watch window...there's a bunch of stuff in
there....not too sure what it all is. ;-)

Is there something in my object that need to define? For example, my Shapes
class looks something like this:

Public Class Shapes
Public Clr as color

public Class Line
Inherits Shapes
.....
end class

public Class Circle
Inherits Shapes
.........
end class
end class

"Brian Swanson" <pu*******@gREMOVETHISmail.com> wrote in message
news:u8**************@TK2MSFTNGP09.phx.gbl...
You should use:

toShapes = iData.GetData(toShapes.GetType)

Hope this helps,
Brian Swanson

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:RT*********@DONTwalchemSPAM.com:
I'm having problem pasting a user defined object that's put into the
clipboard....

Here's a crude example of what I'm trying to get done.

Dim fromShapes as Shapes 'shapes is my custom object
Dim toShapes as Shapes
Clipboard.SetDataObject(fromShapes) ' this works...I can see in
clipboard.exe that it has changed

Dim iData as IDataObject = Clipboard.GetDataObject
toShapes = iData.GetData("NOT SURE WHAT TO PUT HERE")

Thanks.

Nov 21 '05 #3
You should check out this MSDN article for further help:

http://msdn.microsoft.com/library/de...tdatatopic.asp

Hope this helps,
Brian Swanson

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:RT*********@DONTwalchemSPAM.com:
That always returns 'nothing'.

If I view the GetType in a watch window...there's a bunch of stuff in
there....not too sure what it all is. ;-)

Is there something in my object that need to define? For example, my
Shapes
class looks something like this:

Public Class Shapes
Public Clr as color

public Class Line
Inherits Shapes
.....
end class

public Class Circle
Inherits Shapes
.........
end class
end class

"Brian Swanson" <pu*******@gREMOVETHISmail.com> wrote in message
news:u8**************@TK2MSFTNGP09.phx.gbl...
You should use:

toShapes = iData.GetData(toShapes.GetType)

Hope this helps,
Brian Swanson

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:RT*********@DONTwalchemSPAM.com:
I'm having problem pasting a user defined object that's put into the
clipboard....

Here's a crude example of what I'm trying to get done.

Dim fromShapes as Shapes 'shapes is my custom object
Dim toShapes as Shapes
Clipboard.SetDataObject(fromShapes) ' this works...I can see in
clipboard.exe that it has changed

Dim iData as IDataObject = Clipboard.GetDataObject
toShapes = iData.GetData("NOT SURE WHAT TO PUT HERE")

Thanks.


Nov 21 '05 #4
I'm new to VB.Net but I believe you haven't instantiated the object. You
might try

Dim fromShapes as Shapes = NEW SHAPES 'shapes is my custom object
"Rob T" wrote:
That always returns 'nothing'.

If I view the GetType in a watch window...there's a bunch of stuff in
there....not too sure what it all is. ;-)

Is there something in my object that need to define? For example, my Shapes
class looks something like this:

Public Class Shapes
Public Clr as color

public Class Line
Inherits Shapes
.....
end class

public Class Circle
Inherits Shapes
.........
end class
end class

"Brian Swanson" <pu*******@gREMOVETHISmail.com> wrote in message
news:u8**************@TK2MSFTNGP09.phx.gbl...
You should use:

toShapes = iData.GetData(toShapes.GetType)

Hope this helps,
Brian Swanson

"Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
news:RT*********@DONTwalchemSPAM.com:
I'm having problem pasting a user defined object that's put into the
clipboard....

Here's a crude example of what I'm trying to get done.

Dim fromShapes as Shapes 'shapes is my custom object
Dim toShapes as Shapes
Clipboard.SetDataObject(fromShapes) ' this works...I can see in
clipboard.exe that it has changed

Dim iData as IDataObject = Clipboard.GetDataObject
toShapes = iData.GetData("NOT SURE WHAT TO PUT HERE")

Thanks.


Nov 21 '05 #5
Sorry about that. I didn't enter it in my example...my real code, I did
have new in there.

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
I'm new to VB.Net but I believe you haven't instantiated the object. You
might try

Dim fromShapes as Shapes = NEW SHAPES 'shapes is my custom object
"Rob T" wrote:
That always returns 'nothing'.

If I view the GetType in a watch window...there's a bunch of stuff in
there....not too sure what it all is. ;-)

Is there something in my object that need to define? For example, my
Shapes
class looks something like this:

Public Class Shapes
Public Clr as color

public Class Line
Inherits Shapes
.....
end class

public Class Circle
Inherits Shapes
.........
end class
end class

"Brian Swanson" <pu*******@gREMOVETHISmail.com> wrote in message
news:u8**************@TK2MSFTNGP09.phx.gbl...
> You should use:
>
> toShapes = iData.GetData(toShapes.GetType)
>
> Hope this helps,
> Brian Swanson
>
> "Rob T" <RT*********@DONTwalchemSPAM.com> wrote in message
> news:RT*********@DONTwalchemSPAM.com:
>> I'm having problem pasting a user defined object that's put into the
>> clipboard....
>>
>> Here's a crude example of what I'm trying to get done.
>>
>> Dim fromShapes as Shapes 'shapes is my custom object
>> Dim toShapes as Shapes
>> Clipboard.SetDataObject(fromShapes) ' this works...I can see in
>> clipboard.exe that it has changed
>>
>> Dim iData as IDataObject = Clipboard.GetDataObject
>> toShapes = iData.GetData("NOT SURE WHAT TO PUT HERE")
>>
>> Thanks.
>


Nov 21 '05 #6

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

Similar topics

5
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
0
by: DraguVaso | last post by:
Hi, I made some application (VB.NET 2005) based on classes in Windows Forms. I made a new Class Library Project and copied all of my classes and modules in it, to make a DLL that I could import...
0
by: keith | last post by:
I have an Window app that load a user control usercontrol1.dll b Assembly assembly=Assembly.LoadFrom("path\usercontrol1.dll") Control ui=assembly.CreateInstance("NameSpace.ClassName) as Control ...
15
by: Lou | last post by:
How do I get the data in the clipbaord fro a registered data type. The code snippet below doesn't work? But the VB6 example does. What am I doing wrong. private void lstItems_DragDrop(object...
2
by: George Yefchak | last post by:
Hi I need to retrieve a metafile image from the clipboard and render it as a bitmap in my application. In particular, an image will be placed on the clipboard by pasting from PowerPoint (I...
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...
1
by: Alfred Tascon | last post by:
Who knows how to create a Clipboard object/entry that when pasted produces a URL link - a link that when pasted into Word can be ctrl-clicked to launch a browser? Any help appreciated. Oh and i...
1
by: Ludwig Wittgenstein | last post by:
Hi, all. Here's the scenario: I embedd a .txt file in Word as OLE object, then I copy it (manually), so now it's on the clipboard. How do I programatically (in C#) get that OLE object file from...
0
by: Tom | last post by:
What is the best way to cut/copy an internal object to the clipboard and then paste it back in? For instance, I have an internal DataTable that I want to put on the clipboard, and then later on...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.