copy to clipboard error

R

rodchar

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(Object 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.SetText(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
 
R

rodchar

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?
 
F

Family Tree Mike

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top