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

copy to clipboard error

hey all,

i'm using the following in my console app:
My.Computer.Clipboard.SetText(sb.ToString())

i'm getting inconsistent results with the copy. sometimes it works and most
of the time i get the following error below. i just keep executing until it
works.

i'm getting the following error:
Which mode? (1=Read only 2=Edit 3=Insert)
1
Contents are now on the clipboard!

Unhandled Exception: System.Runtime.InteropServices.ExternalException:
Requested
Clipboard operation did not succeed.
at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
at System.Windows.Forms.Clipboard.SetDataObject(Objec t data, Boolean
copy, In
t32 retryTimes, Int32 retryDelay)
at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat
format)

at System.Windows.Forms.Clipboard.SetText(String text)
at Microsoft.VisualBasic.MyServices.ClipboardProxy.Se tText(String text)
at MyHtmlBuilderSolution.Module1.Main() in C:\Documents and
Settings\rodney_s
antiago\My Documents\Visual Studio
2005\Projects\MyHtmlBuilderSolution\MyHtmlBui
lderSolution\Module1.vb:line 24
Press any key to continue . . .

thanks,
rodchar
Jun 27 '08 #1
3 7241
According to MSDN, that could happen if another app is using the clipboard at
the same time.

http://msdn.microsoft.com/en-us/library/tbfb3z56.aspx
"rodchar" wrote:
hey all,

i'm using the following in my console app:
My.Computer.Clipboard.SetText(sb.ToString())

i'm getting inconsistent results with the copy. sometimes it works and most
of the time i get the following error below. i just keep executing until it
works.

i'm getting the following error:
Which mode? (1=Read only 2=Edit 3=Insert)
1
Contents are now on the clipboard!

Unhandled Exception: System.Runtime.InteropServices.ExternalException:
Requested
Clipboard operation did not succeed.
at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
at System.Windows.Forms.Clipboard.SetDataObject(Objec t data, Boolean
copy, In
t32 retryTimes, Int32 retryDelay)
at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat
format)

at System.Windows.Forms.Clipboard.SetText(String text)
at Microsoft.VisualBasic.MyServices.ClipboardProxy.Se tText(String text)
at MyHtmlBuilderSolution.Module1.Main() in C:\Documents and
Settings\rodney_s
antiago\My Documents\Visual Studio
2005\Projects\MyHtmlBuilderSolution\MyHtmlBui
lderSolution\Module1.vb:line 24
Press any key to continue . . .

thanks,
rodchar
Jun 27 '08 #2
this is running on a virtual where this console application is the only thing
going on. i still building this application so when i'm running it i just use
debug/start without debugging. do you think that might have something to do
with it.

is there a proper way to terminate my console application?

"Family Tree Mike" wrote:
According to MSDN, that could happen if another app is using the clipboard at
the same time.

http://msdn.microsoft.com/en-us/library/tbfb3z56.aspx
"rodchar" wrote:
hey all,

i'm using the following in my console app:
My.Computer.Clipboard.SetText(sb.ToString())

i'm getting inconsistent results with the copy. sometimes it works and most
of the time i get the following error below. i just keep executing until it
works.

i'm getting the following error:
Which mode? (1=Read only 2=Edit 3=Insert)
1
Contents are now on the clipboard!

Unhandled Exception: System.Runtime.InteropServices.ExternalException:
Requested
Clipboard operation did not succeed.
at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
at System.Windows.Forms.Clipboard.SetDataObject(Objec t data, Boolean
copy, In
t32 retryTimes, Int32 retryDelay)
at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat
format)

at System.Windows.Forms.Clipboard.SetText(String text)
at Microsoft.VisualBasic.MyServices.ClipboardProxy.Se tText(String text)
at MyHtmlBuilderSolution.Module1.Main() in C:\Documents and
Settings\rodney_s
antiago\My Documents\Visual Studio
2005\Projects\MyHtmlBuilderSolution\MyHtmlBui
lderSolution\Module1.vb:line 24
Press any key to continue . . .

thanks,
rodchar
Jun 27 '08 #3
Sorry, I have no opinions on what may be causing the clipboard to be in use.
I'm not a big fan of virtualization.

As to stoping your code, which I haven't seen, it would seem if you prompt
for a 1, 2, or 3, you could offer -1 to quit. That option in the logic just
quits the app.
"rodchar" wrote:
this is running on a virtual where this console application is the only thing
going on. i still building this application so when i'm running it i just use
debug/start without debugging. do you think that might have something to do
with it.

is there a proper way to terminate my console application?

"Family Tree Mike" wrote:
According to MSDN, that could happen if another app is using the clipboard at
the same time.

http://msdn.microsoft.com/en-us/library/tbfb3z56.aspx
"rodchar" wrote:
hey all,
>
i'm using the following in my console app:
My.Computer.Clipboard.SetText(sb.ToString())
>
i'm getting inconsistent results with the copy. sometimes it works and most
of the time i get the following error below. i just keep executing until it
works.
>
i'm getting the following error:
Which mode? (1=Read only 2=Edit 3=Insert)
1
Contents are now on the clipboard!
>
Unhandled Exception: System.Runtime.InteropServices.ExternalException:
Requested
Clipboard operation did not succeed.
at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
at System.Windows.Forms.Clipboard.SetDataObject(Objec t data, Boolean
copy, In
t32 retryTimes, Int32 retryDelay)
at System.Windows.Forms.Clipboard.SetText(String text, TextDataFormat
format)
>
at System.Windows.Forms.Clipboard.SetText(String text)
at Microsoft.VisualBasic.MyServices.ClipboardProxy.Se tText(String text)
at MyHtmlBuilderSolution.Module1.Main() in C:\Documents and
Settings\rodney_s
antiago\My Documents\Visual Studio
2005\Projects\MyHtmlBuilderSolution\MyHtmlBui
lderSolution\Module1.vb:line 24
Press any key to continue . . .
>
thanks,
rodchar
Jun 27 '08 #4

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

Similar topics

9
by: (Pete Cresswell) | last post by:
I see this coming on a develpment effort that may materialize shortly. These guys don't want to mess around with automated imports from text feeds BC in the past they've had too many problems...
4
by: Wayne Wengert | last post by:
I have an aspx page on which I am trying to copy the contents of a textbox to the client clipboard when the users clicks a button. The button code is as follows:...
2
by: Max81 | last post by:
Im trying to build a calculator for an assignment! (due wednesday) im having trouble finding any code for creating Copy/Paste menu buttons (just need the "doing" code) can anyone help? in...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
3
by: SAL | last post by:
I have the following VB.net Class/Function that I call from an ASP.net page: Public Class MyTestClass Public Function embedHyperlink(ByVal fileID As Integer, ByVal fileName As String) As String...
0
by: mhospodarsky | last post by:
Hi-- I am using VB.Net 2002 for this app. I am working with Tiff and jpeg images. I have a picturebox set up that I use to view the images. I have the picture box inside of a scrollable...
3
by: MLH | last post by:
Say I have a string value in Access - perhaps "ABCDE". How do I copy it to Windoze clipboard? This is not a repost, but is related to a 7/26/06 post entitled "Probs running DoCmd.RunCommand...
8
by: serge calderara | last post by:
Dear all, I have an treeview control with different node object, I would like to implement the Copy/Paste function of an object . For that I am using the folowing function to copy teh object to...
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.