473,408 Members | 2,888 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,408 software developers and data experts.

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 1553
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
1
by: Nukeation | last post by:
My app has to temporarily use the clipboard - and while doing so, it would delete any existing data which the user has copied (possibly from other applications). What I want to do is temporarily...
1
by: keith | last post by:
I read a book, Programming Microsoft WINDOWS with C# by Charles Petzold, which shows ho to set or get string and image to and from Clipboard. It says even a button object can be set or go to and...
6
by: Andy | last post by:
I'm making a drag and drop application, and in the *_DragDrop(...)-method I have the following code: private void SelectTree_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {...
2
by: Shayne H | last post by:
I am trying to write a method to copy some text to the clipboard, and leave a copy of it there after the application has exited. Sub CopyToClipboard(ByVal value As Object) Dim data As New...
6
by: Troels Arvin | last post by:
Hello, In the init-script contained in the RPMs downloadable from the PostgreSQL site (I checked the one for Fedora), an explicit locale is set before running initdb. - And the explicit locale...
4
by: MARTIN LANNY | last post by:
This is how I setup clipboard in my application: dim template as string = "put to clipboard" Clipboard.SetDataObject(template) And it all works like a charm until I close my program. As soon...
1
by: Robert Bravery | last post by:
Hi all, I'm using the following code to copy data from XL to the clipboard to be later usied in a datatable range = objSheet.get_Range("A22", "aa100"); range.Copy(Missing.Value).ToString();...
4
by: shirleylouis | last post by:
Hi Ppl, Could anyone help me out with retrieving URL from Clipboard using C#??
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.