AutoHotkey Community

It is currently May 27th, 2012, 12:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: January 28th, 2010, 4:39 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
I created an instant messenger script so we can communicate from PC to PC in our office. When the user presses reply, an inputbox pops up for the response. About once a week an error message pops on a random PC, when the inputbox would normally pop up, reading "The InputBox window could not be displayed". Reloading the script fixes the problem, but it is so intermittent that it is hard to pin point the problem.

I thought about a line like
Code:
if ERRORLEVEL = 1
   reload

but from what I can tell, even if ERRORLEVEL gets set, I can't test it on the next line because the code stops on the inputbox line with this error message and waits for the user to click OK.

Does anyone have any idea of the underlying cause or at least how to trap this error so the user wouldn't have to see this error message?

Thanks


Last edited by ehagood on January 28th, 2010, 4:46 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 4:45 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
You should show the code snippet with the inputbox so perhaps we can see where the error comes from.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 4:52 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
Here is the section the error occurs in...

Code:
Reply:
GuiControlGet,From
GuiControlGet,SentMessage
Gui, 2:Hide
DisplayMessage("Off")
Sleep, 500
InputBox, MyReply, %MyName%'s Reply, Type your reply below.`n`nTo Previous Message:`n%SentMessage%
if ErrorLevel <> 1
{
  MyReply = [%A_MM%/%A_DD%/%A_YYYY% %A_Hour%:%A_Min%:%A_Sec%] - %MyReply%
  ;msgbox, %MyReply%`n`nPREVIOUS MESSAGE:`n%MessageText%`n%tempName1%-%MyName%.mgr
  SendFileName := FindFileName(From, MyName)
  FileAppend, %MyReply%`n`nPREVIOUS MESSAGE:`n%From%:%SentMessage%,%SendFileName%.mgr
  FileAppend, TO:%From%-FROM:%MyName%->`n`tREPLY: %MyReply%`n, %A_ScriptDir%\message%A_MM%-%A_DD%-%A_YYYY%.log
  boolShowingMessage = False
}
else
{
  msgbox, No Reply Sent.
  Gui, 2:Show, x131 y91 h296 w398
}
FileDelete, %CurrentFile%
DisplayMessage("On")
Return

DisplayMessage(boolWindow)
{
  ifwinexist, Sent Message
    WinSet, AlwaysOnTop, %boolWindow%, Sent Message
  ifwinexist, FPG Network
    WinSet, AlwaysOnTop, %boolWindow%, FPG Network
  Return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 4:56 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
Is the error being generated by AHK or another application?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 4:58 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Perhaps the Vars MyName or SentMessage contain commas? If so I think this could be the problem. You should StringReplace the commas in this vars from , to `,


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 4:59 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
No, I tried the vars with commas, the inputbox gets them right....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 5:05 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
Yeah, it's not a comma issue. Once I reload the script... the InputBox works fine.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 5:09 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Perhaps sometimes the Sentmessage var is too big for the inputbox dialogue?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 5:11 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
aaffe, I wondered that too at first. The message is stored on the network and will continue to display until either a reply or dismiss is clicked. So once I reload the script, the same message, as before, pops up without a problem.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 5:31 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Sorry, but then I cant see an error in your code snippet. Just the return in the function DisplayMessage(boolWindow) isnt needed. But I dont think this causes the problem.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 5:34 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5482
Location: the tunnel(?=light)
Are you able to retrieve the lines most recently executed when the error occurs?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2010, 5:39 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
As of now, no. All the PC's are running the executable instead of the AHK file. If it was a single PC, I could run the script on just that one computer... but it varies from most of the PCs. So, I never know when it is going to happen (just once or twice a month) and on which machine. My last resort is to change all the PC's over to running the script file (which I would also have to install AutoHotKey on all of them as well), I just hoped to figure it out before coming to that.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2011, 4:03 pm 
Offline

Joined: January 30th, 2006, 2:53 pm
Posts: 51
I know that this is a year old issue, but I am reinvestigating it. I have figured out the cause, just not the solution.

PROBLEM DESCRIPTION
Quote:
I created an instant messenger script so we can communicate from PC to PC in our office. When the user presses reply, an inputbox pops up for the response. About once a week an error message pops on a random PC, when the inputbox would normally pop up, reading "The InputBox window could not be displayed". Reloading the script fixes the problem


This AHK executable is located on a public drive on our server. Every night our server automatically shuts down to backup. After that time any PC that was still running during that time (and is still running the script) will encounter this problem.

Does anyone have any thoughts on this?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: chaosad, jrav and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group