Hi there,
I am using EHLLAPI to connect to a mainframe emulator. I can connect to the session and do some major commands (e.g. connect, disconnect, get cursor, set cursor, sendkey, copy ps to string, etc.). The emulator is Rumba version 5.2. What I can't get my Windows app to do is to chain a bunch of commands together. For example: I want to loop where I use Sendkey, then SetCursor, the Sendkey, SetCursor, Copy PS to String, etc.). I can't get the chain of commands to work, only the first two or so work and then nothing. Thanks in advance.
Loading

Sam HobbsRank #108 · 20.5K reputationPosted Oct 19, 2010, 12:56 PM EDT
Brian5 reputationPosted Oct 19, 2010, 6:23 PM EDT
I used this example almost verbatim: http://www.codeproject.com/KB/cs/all_ehllapi.aspx
The only difference is the .dll that Rumba uses. In that sample code there are a few major functions. I am able to use them successfully. But here is what I want to do when I say "chain commands": When a user clicks on one of the buttons on my Windows form I want to call several commands in a row in that click event. For example, I want to do the following: Set the cursor, send in a string, set the cursor, send in another string, etc.
I figured out using some other sample code that the emulator is "busy" when I'm trying to perform functions back-to-back. I don't know if the Wait function is my answer or not. I am still looking into that.
I'm not going to be able to purchase third party software for this solution - the budget doesn't allow for it.
If anyone has seen this kind of thing and has any pointers then I'd be happy to hear them. Thanks.
Sam HobbsRank #108 · 20.5K reputationPosted Oct 19, 2010, 6:42 PM EDT
I don't know what Wait function you are looking at. My guess is that you will need to process the Rumba window to determine when something has completed. There might not be a simple solution.
Brian5 reputationPosted Oct 20, 2010, 7:38 AM EDT
System.Threading.Thread.Sleep(500);
I put this at the top of my SendKey method. Resolved. Thanks.
Sam HobbsRank #108 · 20.5K reputationPosted Oct 20, 2010, 12:57 PM EDT
Hopefully that is all you need to do. The thing I don't know is if the amount of time to wait will be consistent; if you don't wait enough time, it won't work and if you use a wait period long enough to work for most or all situations, then you might be waiting longer than needed for most times. I don't know; that is for you to determine.
Sam HobbsRank #108 · 20.5K reputationPosted Oct 20, 2010, 1:19 PM EDT
Dennis Durham4 reputationPosted Jun 3, 2011, 4:57 AM EDT
Sam HobbsRank #108 · 20.5K reputationPosted Jun 3, 2011, 4:29 PM EDT
Dennis Durham4 reputationPosted Jun 5, 2011, 4:34 AM EDT