CLACom FAQ's - Double Characters with Terminal in C5


C5 seems to be Peeking at its Messages as well as Retrieving them from the Message Queue.

This Peek and the Retrieve was causing problems for the Terminal Emulator because it needs to take over the Clarion Message Loop in order to determine if a key was pressed (Clarion filters the WM_CHAR messages that Windows sends to a program). This is the reason for the Double Characters - the Hook Function that the Terminal uses was seeing the WM_CHAR message twice - once for the Peek and once for the actual Retrieval by the Clarion Message Loop.

CLACom works around this problem and the Terminal Emulator works just fine with C5, but if you've been working with a version of Clarion prior to version 5, you will need to reimport the CLATERM.TXA file into your APP. This applies, even if you've downloaded a new version of CLACom and are having the double character problem.

See the Help File to determine which TXA file you need to Import. Starting with version 4 of Clarion, there are 2 TXA files for Version 4 and Version 5 - one for the ABC Templates and one for the Standard Templates (4 separate files that you can choose from - in addition to the Version 2 TXA file!).

If you've modified the Terminal Emulator, the Quick Fix is as follows:

In the TermHookProc Terminal Procedure, replace this:

    ! Send a User Defined message that
    ! will slip thru
    PostMessage(TermClientWin,EVENT:WM_CHAR,
                WMsg:wParam,WMsg:lParam)

with this:

    ! Send a User Defined message that
    ! will slip thru
    If wParam = 1
       PostMessage(TermClientWin,EVENT:WM_CHAR,
                   WMsg:wParam,WMsg:lParam)
    End