A
active
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
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