By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,899 Members | 1,579 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,899 IT Pros & Developers. It's quick & easy.

copy to clipboard error

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.