469,631 Members | 1,798 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Retrieving Locale data from the clipboard

I'm trying to retrieve Locale data from the clipboard.

I'm not sure if I should use Stream to MemoryStream. I tried both and the
most I could obtain was 4 bytes from the clipboard.

Anyone know how to retrieve Locale data using managed code?

I been trying things like the following:
Dim iData2 As IDataObject = Clipboard.GetDataObject()
If iData2.GetDataPresent(DataFormats.Locale) Then
Dim obj As Object = iData2.GetData(DataFormats.Locale)
If TypeOf obj Is MemoryStream Then
Dim lBuffer(16) As Byte
Dim lCount As Integer
Dim lStream As MemoryStream = CType(obj, MemoryStream)
Dim r As New BinaryReader(lStream)
While (lCount = lStream.Read(lBuffer, 0, 16)) > 0
Dim str As String = ConvertToString( lBuffer, lCount)
RichEditControl1.TxtSelectedText = str & vbCrLf
End While
End If
End If

Even if it does not solve the entire problem if anyone has any sugestions
that I could try I'd appreciate learning about them.
Thanks
Nov 20 '05 #1
1 1453
Cor
Hi active,

The memorystream has nothing to do with copy cut and paste, it gives a
methode to avoid writing to a disk and back if you need to process streaming
data.

I placed beneath a sample for a copy and paste of text.

Also a link

http://msdn.microsoft.com/library/en...ardSupport.asp
Here is everything nice described.

I hope this was what you needed?

Cor

Copy
\\\
Me.textbox1.SelectAll()
Clipboard.SetDataObject(me.textbox1.SelectedText)
///
Paste
\\\
Dim iData As IDataObject = Clipboard.GetDataObject()
If iData.GetDataPresent(DataFormats.Text) Then
Me.textbox2.Text = CType(iData.GetData(DataFormats.Text), String)
Else
Me.textbox2.Text = ""
End If
///
I'm trying to retrieve Locale data from the clipboard.
I'm not sure if I should use Stream to MemoryStream. I tried both and the
most I could obtain was 4 bytes from the clipboard.
Anyone know how to retrieve Locale data using managed code?
I been trying things like the following:

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Roger Leigh | last post: by
1 post views Thread by Nukeation | last post: by
1 post views Thread by keith | last post: by
6 posts views Thread by Troels Arvin | last post: by
1 post views Thread by Robert Bravery | last post: by
4 posts views Thread by shirleylouis | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.