Copying data from Clipboard for PocketPC 2003

  • Thread starter Steve Payze via .NET 247
  • Start date
S

Steve Payze via .NET 247

I am writing an application for a Pocket PC 2003 and want to retrieve some data from off the clipboard with Visual Basic .NET. The MSDN help gives the following:

Private Sub button2_Click(sender As Object, e As System.EventArgs)
' Declares an IDataObject to hold the data returned from the clipboard.
' Retrieves the data from the clipboard.
Dim iData As IDataObject = Clipboard.GetDataObject()

' Determines whether the data is in a format you can use.
If iData.GetDataPresent(DataFormats.Text) Then
' Yes it is, so display it in a text box.
textBox2.Text = CType(iData.GetData(DataFormats.Text), String)
Else
' No it is not.
textBox2.Text = "Could not retrieve data off the clipboard."
End If
End Sub 'button2_Click

When I build the project I keep getting the error 'error BC30002: Type 'IDataObject' is not defined.' I have added the statements
Imports System.Object
but this does not help. Any ideas ?
 
P

Peter Foot [MVP]

Clipboard support is not included in .NETCF v1.0. However there is an
equivalent class in the OpenNETCF Smart Device Framework
(www.opennetcf.org/sdf/) this was designed to have an object model just like
the full .NET framework, however it currently only supports text. After
installing SDF, add a reference to OpenNETCF.Windows.Forms.dll and add
Imports OpenNETCF.Windows.Forms
to the top of your code file. Then you can call the Clipboard object and
associated classes as they work in your example below

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 

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