AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

can't open CLIPBOARD for writing

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Wed Sep 12, 2007 4:30 pm    Post subject: can't open CLIPBOARD for writing Reply with quote

this
Code:
   sendevent +{insert} ; ^v
   ;sleep -1
   ;clipwait, 0.01
   ;sleep 70
   clipboard := ClipSaved
often results in this
Quote:
can't open keyboard for writing
error.
_________________
Joyce Jamce


Last edited by Joy2DWorld on Mon Nov 12, 2007 6:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6309
Location: Pacific Northwest, US

PostPosted: Wed Sep 12, 2007 4:38 pm    Post subject: Reply with quote

does it ever happen if you put the clipwait back in? (with larger value like 0.5)
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Thu Sep 13, 2007 8:02 pm    Post subject: Reply with quote

engunneer wrote:
does it ever happen if you put the clipwait back in? (with larger value like 0.5)
yes. even values like 30 seconds eventually generate error.

have seen generally my previous efforts to help debug AHK, don't seem to have any value.

My intent only to raise the issue. if anyone cares, great. if not, not.
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Thu Sep 13, 2007 11:19 pm    Post subject: Reply with quote

interestingly,

Code:
saveto := ClipboardAll


will sometimes cause AHK to freeze (ie. hang) if clipboard is empty.


likely should be a different thread, but as seems I am the only one to be bothered by this, not worth the effort of further invest.
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Sun Nov 11, 2007 10:44 pm    Post subject: Reply with quote

Sorry for the late reply. I can't reproduce this with your examples, even when using MS Word with a large amount of RTF text on the clipboard. If anyone else can reproduce this, it would help to know which application(s) it affects, or some more precise steps to reproduce it.

As a shared resource, the clipboard has always been prone to conflicts, possibly even deadlocks (perhaps Vista alleviates this). Even if we can reproduce the problem, there might not be an easy solution.
Back to top
View user's profile Send private message Send e-mail
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Mon Nov 12, 2007 3:08 am    Post subject: Reply with quote

often occurs in SCITe (for example).




(my temp. solution, which you might (or not) want to include in standard ahk,


was basically just add an openclipboard call loop to confirm (returns true if am remembering correct) when CB can actually be opened. If am remembering correctly, the AHK code was testing (once ?), but not looping release and retest. (it's been a while ... )
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3943
Location: Pittsburgh

PostPosted: Mon Nov 12, 2007 3:24 am    Post subject: Reply with quote

Could you rename the thread? It is not the keyboard, but the ClipBoard…
Back to top
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Mon Nov 12, 2007 5:53 pm    Post subject: Reply with quote

Laszlo wrote:
Could you rename the thread? It is not the keyboard, but the ClipBoard…


ahhh.... how true.
_________________
Joyce Jamce


Last edited by Joy2DWorld on Mon Nov 12, 2007 6:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6309
Location: Pacific Northwest, US

PostPosted: Mon Nov 12, 2007 6:00 pm    Post subject: Reply with quote

I did, but you make a good point - reverted. You can also edit it at your will in the future.

I apologize for not reading carefully enough before changing it.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Mon Nov 12, 2007 6:06 pm    Post subject: Reply with quote

engunneer wrote:
I did, but you make a good point - reverted. You can also edit it at your will in the future.

I apologize for not reading carefully enough before changing it.



ok, I redouble your apology and apologize ... Laszlo is 100% correct. (I had played with the error messages in my own 'fixed' vers, to differentiate, and in looking at the original BIN see actuall 'normal' message is indeed "clipboard"....)
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Tue Nov 13, 2007 12:08 pm    Post subject: Reply with quote

Joy2DWorld wrote:
(my temp. solution, which you might (or not) want to include in standard ahk, was basically just add an openclipboard call loop to confirm (returns true if am remembering correct) when CB can actually be opened. If am remembering correctly, the AHK code was testing (once ?), but not looping release and retest. (it's been a while ... )
Internally, AutoHotkey calls OpenClipboard() in a loop with a sleep and message-check between each set of attempts. It does this until the clipboard can be opened or the #ClipboardTimeout period is over.
Back to top
View user's profile Send private message Send e-mail
Joy2DWorld



Joined: 04 Dec 2006
Posts: 404
Location: Galil, Israel

PostPosted: Tue Nov 13, 2007 9:01 pm    Post subject: Reply with quote

it's been a while. might be added a pre-loop to open and close before re-oppening. IF ACTUALLY RELEVANT AND HELPFUL, will go back and look at what have set up.

Am not sure if you can relate to this (and understand you have your own issues, time constraints, perspective, direction for the code, etc.), but something like: I really really like AHK, as a programming platform, it does *many* amazing and fun things which can open programming to wider range of minds, *but*,

a couple of solved/solveable problems kills my ability to get others enthused or involved. Top on the list of problems is the ghost control ke presses to avoid menu activations. The solution was great, but today, makes AHK come over (to those with system conflicts) as buggy and 'not ready for prime time'. [if you had a control key activate langauge changer on your system, or you used the windows system show cursor on control press-- very likely you would feel the same way].


anyhow, on my own 'private build' that's not a problem--> but it doesn't let me get others involved with AHK, and.. anyhow,


my feeling is that trying to get the/a solution (even as an option) was somehow a bother, and not a help.

have no intention to bother. AHK is cool. If taking the time to debug/find solutions is truly welcome and helpful, great.
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Warden



Joined: 04 Jan 2008
Posts: 10

PostPosted: Mon Jun 23, 2008 2:48 am    Post subject: Error: Can't open clipboard for writing Reply with quote

I get the same error with either of the following statements

Clipboard = ; Empty the clipboard
or
Clipboard := "" ; Empty the clipboard


I get the error consistently when I shell to an AHK exe from one application that I have written in vb.net 2003.

I do not get the error at all when I shell to excactly the same AHK exe from a different subroutine in the same application.

The line that I use to shell to the ahk routine is exactly the same. I copied and pasted it. To double check, I inverted the copy and paste.

The line is the first statement in the ahk programme.

I am totally confused.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group