ICE

Please login or register.

Login with username, password and session length
Advanced search  

News:

ICETCP.PRO and ICETCP.PLUS are compatible with Windows 11!

Pages: [1] 2 3

Author Topic: OLE-API Questions  (Read 18747 times)

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
OLE-API Questions
« on: January 07, 2004, 02:39:43 pm »

When is the best time to do things like:
   set terminal type
   set color mapping flag
   set colors
   set key maps
   etc.
Right after issuing the Connect method
or
While processing the OnConnectionComplete event.

I noticed that some things, like set terminal type, can only be done after a connection is established so I do all setups after a connection is established.  Maybe some items can be setup before the connection is established.
« Last Edit: February 20, 2004, 12:55:14 pm by Bob »
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
Re:OLE-API When best to update terminal type, etc.
« Reply #1 on: January 08, 2004, 05:01:14 pm »

When is the best time to do things like:
   set terminal type
   set color mapping flag
   set colors
   set key maps
   etc.
Right after issuing the Connect method
or
While processing the OnConnectionComplete event.

I noticed that some things, like set terminal type, can only be done after a connection is established so I do all setups after a connection is established.  Maybe some items can be setup before the connection is established.

I'll check into that in more detail, however it's important to note that some things that are passed on connection, most importantly the terminal type, so the remote host has no way to know if you have changed the terminal type AFTER you have a connection. Some versions of Unix can properly respond to a lines/columns change after connection but this is not universal.

Changing things that are only cosmetic, like the color attributes is fine to do after the connection is established.
« Last Edit: January 15, 2004, 10:29:33 am by Bob »
Logged

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
OLE-API Questions
« Reply #2 on: January 28, 2004, 05:00:11 pm »

For Example.
1. Bring focus to the OCX control.
2. Connect to a host.
3. Press the Caps Lock key to turn ON the Caps Lock light on the keyboard.
4. Notice that pressing the letter keys gives upper case letters.
5. Move focus away from the application with the OCX control, like to the desk top.
6. Press the Caps Lock key to turn OFF the Caps Lock light on the keyboard.
7. Bring focus back to the OCX control.
8. Notice that pressing the letter keys continues to give upper case letters.
9. Press the Caps Lock key to turn ON the Caps Lock light on the keyboard.
10. Notice that pressing the letter keys now to gives lower case letters with the Caps Lock Light on.
11. Telnet Pro does not misbehave this way.

Has anyone else seen this or can it be something in my application? :-\

« Last Edit: February 20, 2004, 12:50:32 pm by Bob »
Logged

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
Re:OLE-API Trouble With Caps Lock
« Reply #3 on: January 29, 2004, 09:30:48 am »

Additional information:
1. A disconnect - connect cycle will restore the Caps Lock synchronicity.
2. Even when synchronized, with the Caps Lock on and holding down the shift key, pressing the letter keys gives upper case letters instead of lower case letters.
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
Re:OLE-API Trouble With Caps Lock
« Reply #4 on: January 29, 2004, 03:00:30 pm »

Additional information:
2. Even when synchronized, with the Caps Lock on and holding down the shift key, pressing the letter keys gives upper case letters instead of lower case letters.

Normal behavior. We do this on purpose to mimic what a terminal does.
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Trouble With Caps Lock
« Reply #5 on: January 29, 2004, 03:23:50 pm »

For Example.
1. Bring focus to the OCX control.
2. Connect to a host.
3. Press the Caps Lock key to turn ON the Caps Lock light on the keyboard.
4. Notice that pressing the letter keys gives upper case letters.
5. Move focus away from the application with the OCX control, like to the desk top.
6. Press the Caps Lock key to turn OFF the Caps Lock light on the keyboard.
7. Bring focus back to the OCX control.
8. Notice that pressing the letter keys continues to give upper case letters.
9. Press the Caps Lock key to turn ON the Caps Lock light on the keyboard.
10. Notice that pressing the letter keys now to gives lower case letters with the Caps Lock Light on.
11. Telnet Pro does not misbehave this way.

Has anyone else seen this or can it be something in my application? :-\


Telnet Pro saves the state of the "shift" keys (shift, alt, caps-lock and control) internally. When regaining focus from outside, it rereads the state of those keys and resyncs the internal copy. I'm not sure how you would handle that in your app. I THINK if you do a SetScanCodeMode(true) then ScanCodeMode(false) it will clear the internal flags but then I think you'd have to do the same for windows at the same time.
Logged

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
Re:OLE-API Trouble With Caps Lock
« Reply #6 on: January 30, 2004, 02:29:03 pm »

The SetScanCodeMode procedure didn't resync the Caps Lock but you sent me in the correct direction.  In the windows event OnActivate I use the GetKeyState and SendInput to remember and restore the key states.
Thanks.
Also, both the OCX and Telnet Pro have the equivalent problem with the SHIFT key.  In Pro, press and hold the SHIFT key, use the mouse to move focus to the desk top, release the SHIFT key, return focus to Pro and Pro thinks the SHIFT key is still pressed.  I don't know why anyone would do that but it is interesting.
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
Re:OLE-API Trouble With Caps Lock
« Reply #7 on: January 30, 2004, 03:19:00 pm »

The SetScanCodeMode procedure didn't resync the Caps Lock but you sent me in the correct direction.  In the windows event OnActivate I use the GetKeyState and SendInput to remember and restore the key states.
Thanks.
Also, both the OCX and Telnet Pro have the equivalent problem with the SHIFT key.  In Pro, press and hold the SHIFT key, use the mouse to move focus to the desk top, release the SHIFT key, return focus to Pro and Pro thinks the SHIFT key is still pressed.  I don't know why anyone would do that but it is interesting.

Excellent, Thanks for the feedback!
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Docs ONLINE
« Reply #8 on: July 22, 2004, 01:20:26 pm »

See:

ftp://ftp.jriver.com/pub/downloads/ICETCP.PRO.SDK/

For API docs and sample programs. Note that the debug version of dejavu.ocx (which provides the API) is NOT included. You can use your existing dejavu.ocx to try out the API functions and samples.
Logged

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
Re:OLE-API Questions
« Reply #9 on: July 22, 2004, 03:14:30 pm »

ESP!  Just this morning I thought about getting online and checking for updates.  I can't wait to try the TraceViewer.  Thanks.
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Questions
« Reply #10 on: July 22, 2004, 04:05:32 pm »

You might need the debug version of the dejavu.ocx for that. We are working on the next release so that won't be available until the release date.
Logged

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
Re:OLE-API Questions
« Reply #11 on: July 30, 2004, 10:51:08 am »

My debug OCX is dated 07/13/2000 and I never could get it to register anyway.  I have a question but I am not sure if it should be a new thread.
1.  I see that version 5.1.21 fixed the sync problem with the Shift Key and the Caps Lock Key.  Now I need a way for my program to discover the version number of the OCX because my program shouldn't attempt to synchronize these keys for version 5.1.21.
2. A feature of my program that does "GetScreenContents", changes the color attributes, and then does "SetScreenContents", no longer functions with version 5.1.21.
So my question is: How do I obtain the version information from the OCX?
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
Re:OLE-API Questions
« Reply #12 on: July 30, 2004, 12:23:31 pm »

My debug OCX is dated 07/13/2000 and I never could get it to register anyway.  I have a question but I am not sure if it should be a new thread.
1.  I see that version 5.1.21 fixed the sync problem with the Shift Key and the Caps Lock Key.  Now I need a way for my program to discover the version number of the OCX because my program shouldn't attempt to synchronize these keys for version 5.1.21.
I'll check with the person who knows the OCX on Monday and update this post then.
Quote
2. A feature of my program that does "GetScreenContents", changes the color attributes, and then does "SetScreenContents", no longer functions with version 5.1.21.
So my question is: How do I obtain the version information from the OCX?
Interesting, sounds like another unwanted side effect of statically linking  mfc42.dll. It really shouldn't have changed the behavior but it does seem to have affected the bold fonts as well. Will check into that more on Monday as well. Thanks for the report!
Logged

jmabbott

  • John
  • Full Member
  • ***
  • Posts: 23
Re:OLE-API Questions
« Reply #13 on: August 16, 2004, 03:16:58 pm »

This question is about setting colors via GetScreenContent and SetScreenContent.
Reference your documentation at figure 1.7 on page 24 which shows all possible combinations of background and foreground colors.  The background colors (and foreground colors) look as expected for rows 0 thru 7 and rows 10 thru 15. Rows 8 and 9, which are background color index values 8 and 9, do not have a uniform background color like the other rows.
If I set the attributes to 9F for white letters on a blue background the screen actually shows white letters on a teal background and a GetScreenContents shows the attributes to be 3F which is correct for the color displayed but it is not the 9F that I set.
Using SetColor works properly and all new text display as expected.
Are there any special rules for the background color index values of 8 and 9 when setting attributes via SetScreenContents?
Logged

Bob

  • Administrator
  • Ice Artist
  • *****
  • Posts: 1607
OLE-API Questions
« Reply #14 on: August 16, 2004, 03:32:17 pm »

Is the background color setting the only difference you noticed between the 5.1.21 version of the OCX and the older versions? That could be a good clue as to what is going on. The programmer who is most familar with OCX is out until next week. I'll pass this info on to him.

From the point of view of the emulator core, there is a conflict between the "blink" bit and the topmost BG (high intensity) bit. I don't think you've run into that though. The other possibility is that you are in an alternate character set which could invalidate this bit as well. Since you have said that it works on the older OCX though I would not think that either of these ideas would come into play.

As far as getting the version is concerned, there doesn't appear to be a way to get that in the OCX. The only workaround that I can think of is to check the creation date of the OCX.
Logged
Pages: [1] 2 3
 

Page created in 0.059 seconds with 20 queries.