Dart Home | PowerTCP Emulation for ActiveX | Custom Development | Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
Author | Forum: PowerTCP Emulation / Telnet for ActiveX Topic: 12011 Blocking the Thread |
User688 Posts: 7 Member Since: 03/23/01 |
posted June 14, 2001 1:58 PM I am using the telnet control in conjunction with the VT control to create a very simple terminal emulator. This is the only code I am using. 'If not connected on keystroke then connect If Telnet1.State <> tcpConnected Then HostName = "192.168.1.3" Telnet1.Connect HostName, "23" Exit Sub End If 'If already connected then send keystroke If Telnet1.State = tcpConnected Then Telnet1.Send KeyAscii End If It works fine unless you begin to type really fast.At that point I get: Runtime error 12011. A methode is currently blocking the thread...... Any suggestions. Thanks |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 14, 2001 2:18 PM The connect is going to take some time to return, but windows messages are still being processed. Therefore, if you hit a key before connect returns another KeyPress event is fired which causes the error. Tony |
User688 Posts: 7 Member Since: 03/23/01 |
posted June 14, 2001 2:28 PM Thank for you quick response. What should I do to prevent this. I have looked over the Help as well as the sample emulator an I see nothing that looks like a preventative to the problem. Thanks |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 14, 2001 2:33 PM I would display a warning that the connection was closed, then put up a modal dialog box (NOT A MESSAGE BOX (they block) ) that informs the user that connection is being made. If the connection fails display a message and exit the sub. If you have priority support, I can write a sample for you. Thanks, Tony |
User688 Posts: 7 Member Since: 03/23/01 |
posted June 14, 2001 2:50 PM I do not get this message when I am connecting. I have already opened a telnet session, logged-in and have began using the application. If I accidently "Fat Finger" the keyboard and hit two keys at once I get the message. Thanks for your help |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 14, 2001 2:57 PM Sounds like you are mixing blocking and non-blocking operations. What do you have timeout set to? Does the sample app do the same thing? Thanks, Tony |
User688 Posts: 7 Member Since: 03/23/01 |
posted June 14, 2001 4:03 PM No both applications do not do the same thing. Timeout is set @ 30000. I think I may have found a solution. I trapped the error and resumed next. I no longer get the error. Do you see any problems with this solution. Thanks |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted June 14, 2001 4:22 PM I always see a problem with resume next. It hides many potential problems. A client where there is interaction should not be written in blocking mode (Timeout > 0). You should do it the way we do in the sample. Tony |
amancini From: Providnence, RI USA Posts: 2 Member Since: 09/04/03 |
posted September 4, 2003 5:00 PM I've been reading this posting and I came across the same problem. Where would the sample code be that Tony has mentioned? Thanks. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted September 4, 2003 5:10 PM I was referring to the samples that come with the product. |
amancini From: Providnence, RI USA Posts: 2 Member Since: 09/04/03 |
posted September 5, 2003 8:33 AM Can you please forward this sample code, although we do have a license our previous Network Administrator seems to have misplaced our documentation. Please help. Thanks in advance. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted September 5, 2003 9:19 AM You can download the trial from: http://www.dart.com/downloads/emulationtool.exe |
Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
This site is powered by
![]() |