Help - Personal Communications
Help - Personal Communications
An example of this would be sending keys to Personal Communications presentation space. This can be accomplished by
manually typing keys in the Personal Communications window, but it can also be automated through the appropriate Personal
Communications automation server (autECLPS in this case). Using Visual Basic you can create the autECLPS object and
then call the SendKeys method in that object with the string that is to be placed in the presentation space.
In other words, applications that are enabled for controlling the automation protocol (automation controller) can control some
Personal Communications operations (automation server). Personal Communications supports Visual Basic Script, which
uses ECL Automation objects. Refer to the Personal Communications Macro/Script support for more details.
Personal Communications offers several automation servers to accomplish this. These servers are implemented as
real-world, intuitive objects with methods and properties that control Personal Communications operability. Each object begins
with autECL, for automation Host Access Class Library. The objects are as follows:
autECLConnList, Connection List, on page "autECLConnList Class", contains a list of Personal Communications
connections for a given system. This is contained by autECLConnMgr, but may be created independently of
autECLConnMgr.
autECLConnMgr, Connection Manager, on page "autECLConnMgr Class", provides methods and properties to
manage Personal Communications connections for a given system. A connection in this context is a Personal
Communications window.
autECLFieldList, Field List, on page "autECLFieldList Class", performs operations on fields in an emulator
presentation space.
autECLOIA, Operator Information Area, on page "autECLOIA Class", provides methods and properties to query and
manipulate the Operator Information Area. This is contained by autECLSession, but may be created independently of
autECLSession.
autECLPS, Presentation Space, on page "autECLPS Class", provides methods and properties to query and
manipulate the presentation space for the related Personal Communications connection. This contains a list of all the
fields in the presentation space. It is contained by autECLSession, but may be created independently of
autECLSession.
autECLScreenDesc, Screen Description, on page "autECLScreenDesc Class", provides methods and properties to
describe a screen. This may be used to wait for screens on the autECLPS object or the autECLScreenReco object.
autECLScreenReco, Screen Recognition, on page "autECLScreenReco Class", provides the engine of the HACL
screen recognition system.
autECLSession, Session, on page "autECLSession Class", provides general session-related functionality and
information. For convenience, it contains the autECLPS, autECLOIA, autECLXfer, autECLWinMetrics,
autECLPageSettings, and autECLPrinterSettings objects.
autECLWinMetrics, Window Metrics, on page "autECLWinMetrics Class", provides methods to query the window
metrics of the Personal Communications session associated with this object. For example, use this object to minimize
or maximize a Personal Communications window. This is contained by autECLSession, but may be created
independently of autECLSession.
autECLXfer, File Transfer, on page "autECLXfer Class", provides methods and properties to transfer files between
the host and the workstation over the Personal Communications connection associated with this file transfer object.
This is contained by autECLSession, but may be created independently of autECLsession.
autECLPageSettings, Page Settings, on page "autECLPageSettings Class", provides methods and properties to
query and manipulate commonly used settings such as CPI, LPI, and Face Name of the session Page Setup dialog.
This is contained by autECLSession, but may be created independently of autECLSession.
autECLPrinterSettings, Printer Settings, on page "autECLPrinterSettings Class", provides methods and properties to
query and manipulate settings such as the Printer and PDT modes of the session Printer Setup dialog. This is
contained by autECLSession, but may be created independently of autECLSession.
This chapter describes each object's methods and properties in detail and is intended to cover all potential users of the
automation object. Because the most common way to use the object is through a scripting application such as Visual Basic,
all examples are shown using a Visual Basic format.
autSystem Class
The autSystem Class provides two utility functions that may be useful for use with some programming languages. See
autSystem Class for more information.
autECLConnList Class
autECLConnList contains information about all started connections. Its name in the registry is PCOMM.autECLConnList.
The autECLConnList object contains a collection of information about connections to a host. Each element of the collection
represents a single connection (emulator window). A connection in this list may be in any state (for example, stopped or
disconnected). All started connections appear in this list. The list element contains the state of the connection.
An autECLConnList object provides a static snapshot of current connections. The list is not dynamically updated as
connections are started and stopped. The Refresh method is automatically called upon construction of the autECLConnList
object. If you use the autECLConnList object right after its construction, your list of connections is current. However, you
should call the Refresh method in the autECLConnList object before accessing its other methods if some time has passed
since its construction to ensure that you have current data. Once you have called Refresh you may begin walking through the
collection
Properties
Count
This is the number of connections present in the autECLConnList collection for the last call to the Refresh method. The Count
property is a Long data type and is read-only. The following example uses the Count property.
autECLConnList.Refresh
Num = autECLConnList.Count
The following table shows Collection Element Properties, which are valid for each item in the list.
Name
This collection element property is the connection name string of the connection. Personal Communications only returns the
short character ID (A-Z) in the string. There can be only one Personal Communications connection open with a given name.
For example, there can be only one connection "A" open at a time. Name is a String data type and is read-only. The following
example uses the Name collection element property.
autECLConnList.Refresh
Str = autECLConnList(1).Name
Handle
This collection element property is the handle of the connection. There can be only one Personal Communications
connection open with a given handle. Handle is a Long data type and is read-only. The following example uses the Handle
property.
autECLConnList.Refresh
Hand = autECLConnList(1).Handle
ConnType
This collection element property is the connection type. This type may change over time. ConnType is a String data type and
is read-only. The following example shows the ConnType property.
autECLConnList.Refresh
Type = autECLConnList(1).ConnType
CodePage
This collection element property is the code page of the connection. This code page may change over time. CodePage is a
Long data type and is read-only. The following example shows the CodePage property.
autECLConnList.Refresh
CodePage = autECLConnList(1).CodePage
Started
This collection element property indicates whether the emulator window is started. The value is True if the window is open;
otherwise, it is False. Started is a Boolean data type and is read-only. The following example shows the Started property.
Result.Text = "No"
Else
Result.Text = "Yes"
End If
CommStarted
This collection element property indicates the status of the connection to the host. The value is True if the host is connected;
otherwise, it is False. CommStarted is a Boolean data type and is read-only. The following example shows the CommStarted
property.
APIEnabled
This collection element property indicates whether the emulator is API-enabled. A connection may be enabled or disabled
depending on the state of its API settings (in a Personal Communications window, choose File -> API Settings). The value is
True if the emulator is enabled; otherwise, it is False. APIEnabled is a Boolean data type and is read-only. The following
example shows the APIEnabled property.
Ready
This collection element property indicates whether the emulator window is started, API-enabled, and connected. This property
checks for all three properties. The value is True if the emulator is ready; otherwise, it is False. Ready is a Boolean data type
and is read-only. The following example shows the Ready property.
autECLConnList Methods
The following section describes the methods that are valid for the autECLConnList object.
void Refresh()
Object FindConnectionByHandle(Long Hand)
Object FindConnectionByName(String Name)
The following collection element methods are valid for each item in the list.
void StartCommunication()
void StopCommunication()
Refresh
Note:
You should call this method before accessing the autECLConnList collection to ensure that you have current data.
Prototype
void Refresh()
Parameters
None
Return Value
None
Example
The following example shows how to use the Refresh method to get a snapshot of all the started connections.
FindConnectionByHandle
This method finds an element in the autECLConnList object for the handle passed in the Hand parameter. This method is
commonly used to see if a given connection is alive in the system.
Prototype
Parameters
Long Hand
Handle to search for in the list.
Return Value
Object
Collection element dispatch object.
Example
The following example shows how to find an element by the connection handle.
FindConnectionByName
This method finds an element in the autECLConnList object for the name passed in the Name parameter. This method is
commonly used to see if a given connection is alive in the system.
Prototype
Parameters
String Name
Name to search for in the list.
Return Value
Object
Collection element dispatch object.
Example
The following example shows how to find an element in the autECLConnList object by the connection name.
StartCommunication
The StartCommunication collection element method connects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Connect.
Prototype
void StartCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
StopCommunication
The StopCommunication collection element method disconnects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
Prototype
void StopCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to disconnect a PCOMM emulator session from the host.
autECLConnMgr Class
autECLConnMgr manages all Personal Communications connections on a given machine. It contains methods relating to the
connection management such as starting and stopping connections. It also creates an autECLConnList object to enumerate
the list of all known connections on the system (see autECLConnList Class). Its name in the registry is
PCOMM.autECLConnMgr.
Properties
autECLConnList
The autECLConnMgr object contains an autECLConnList object. See autECLConnList Class for details on its methods and
properties. The property has a value of autECLConnList, which is an autECLConnList dispatch object. The following example
shows this property.
Mgr.autECLConnList.Refresh
Num = Mgr.autECLConnList.Count
autECLConnMgr Methods
The following section describes the methods that are valid for autECLConnMgr.
void RegisterStartEvent()
void UnregisterStartEvent()
void StartConnection(String ConfigParms)
void StopConnection(Variant Connection, [optional] String StopParms)
RegisterStartEvent
This method registers an autECLConnMgr object to receive notification of start events in sessions.
Prototype
void RegisterStartEvent()
Parameters
None
Return Value
None
Example
UnregisterStartEvent
Prototype
void UnregisterStartEvent()
Parameters
None
Return Value
None
Example
StartConnection
This member function starts a new Personal Communications emulator window. The ConfigParms string contains connection
configuration information as explained under Usage Notes.
Prototype
Parameters
String ConfigParms
Configuration string.
Return Value
None
Usage Notes
The configuration string is implementation-specific. Different implementations of the autECL objects may require different
formats or information in the configuration string. The new emulator is started upon return from this call, but it may or may not
be connected to the host.
For Personal Communications, the configuration string has the following format:
Optional parameters are enclosed in square brackets []. The parameters are separated by at least one blank. Parameters may
be in upper, lower, or mixed case and may appear in any order. The meaning of each parameter is as follows:
PROFILE=<filename>: Names the Personal Communications workstation profile (.WS file), which contains the
configuration information. This parameter is not optional; a profile name must be supplied. If the file name contains
blanks the name must be enclosed in single quotation marks. The <filename> value may be either the profile name
with no extension, the profile name with the .WS extension, or the fully qualified profile name path.
CONNNAME=<c> specifies the short ID of the new connection. This value must be a single, alphabetic character
(A-Z). If this value is not specified, the next available connection ID is assigned automatically.
WINSTATE=<MAX|MIN|RESTORE|HIDE> specifies the initial state of the emulator window. The default if this
parameter is not specified is RESTORE.
Example
The following example shows how to start a new Personal Communications emulator window.
StopConnection
The StopConnection method stops (terminates) the emulator window identified by the connection handle. See Usage Notes
for contents of the StopParms string.
Prototype
Parameters
Variant Connection
Connection name or handle. Legal types for this variant are short, long, BSTR, short by reference, long by reference, and
BSTR by reference.
String StopParms
Stop parameters string. See usage notes for format of string. This parameter is optional.
Return Value
None
Usage Notes
The stop parameter string is implementation-specific. Different implementations of the autECL objects may require a different
format and contents of the parameter string. For Personal Communications, the string has the following format:
[SAVEPROFILE=<YES|NO|DEFAULT>]
Optional parameters are enclosed in square brackets []. The parameters are separated by at least one blank. Parameters may
be in upper, lower, or mixed case and may appear in any order. The meaning of each parameter is as follows:
SAVEPROFILE=<YES|NO|DEFAULT> controls the saving of the current configuration back to the workstation profile
(.WS file). This causes the profile to be updated with any configuration changes you may have made. If NO is
specified, the connection is stopped and the profile is not updated. If YES is specified, the connection is stopped and
the profile is updated with the current (possibly changed) configuration. If DEFAULT is specified, the update option is
controlled by the File->Save On Exit emulator menu option. If this parameter is not specified, DEFAULT is used.
Example
The following example shows how to stop the emulator window identified by the connection handle.
' Assume we've got connections open and the Hand parm was obtained earlier
Mgr.StopConnection Hand, "saveprofile=no"
'or
Mgr.StopConnection "B", "saveprofile=no"
autECLConnMgr Events
The following events are valid for autECLConnMgr:
void NotifyStartEvent(By Val Handle As Variant, By Val Started As Boolean)
NotifyStartError(By Val ConnHandle As Variant)
void NotifyStartStop(Long Reason)
NotifyStartEvent
Prototype
Note:
Visual Basic will create this subroutine correctly.
Parameters
Example
NotifyStartError
Prototype
Note:
Visual Basic will create this subroutine correctly.
Parameters
None
Example
NotifyStartStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently, this will always be 0.
Option Explicit
sub main()
'Create Objects
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
mCmgr.UnregisterStartEvent
End Sub
if (bStarted) then
mSess.SetConnectionByHandle Handle
end if
End Sub
End Sub
End Sub
autECLFieldList Class
autECLFieldList performs operations on fields in an emulator presentation space. This object does not stand on its own. It is
contained by autECLPS, and can only be accessed through an autECLPS object. autECLPS can stand alone or be contained
by autECLSession.
autECLFieldList contains a collection of all the fields on a given presentation space. Each element of the collection contains
the elements shown in Collection Element Properties.
An autECLFieldList object provides a static snapshot of what the presentation space contained when the Refresh method
was called.
Note:
You should call the Refresh method in the autECLFieldList object before accessing its elements to ensure that you have
current field data. Once you have called Refresh, you may begin walking through the collection.
Properties
This section describes the properties and the collection element properties for the autECLFieldList object.
Count
This property is the number of fields present in the autECLFieldList collection for the last call to the Refresh method. Count is
a Long data type and is read-only. The following example shows this property.
The following properties are collection element properties and are valid for each item in the list.
StartRow
This collection element property is the row position of the first character in a given field in the autECLFieldList collection.
StartRow is a Long data type and is read-only. The following example shows this property.
StartCol
This collection element property is the column position of the first character in a given field in the autECLFieldList collection.
StartCol is a Long data type and is read-only. The following example shows this property.
EndRow
This collection element property is the row position of the last character in a given field in the autECLFieldList collection.
EndRow is a Long data type and is read-only. The following example shows this property.
EndCol
This collection element property is the column position of the last character in a given field in the autECLFieldList collection.
EndCol is a Long data type and is read-only. The following example shows this property.
Length
This collection element property is the length of a given field in the autECLFieldList collection. Length is a Long data type and
is read-only. The following example shows this property.
Modified
This collection element property indicates if a given field in the autECLFieldList collection has a modified attribute. Modified is
a Boolean data type and is read-only. The following example shows this property.
Protected
This collection element property indicates if a given field in the autECLFieldList collection has a protected attribute. Protected
is a Boolean data type and is read-only. The following example shows this property.
Numeric
This collection element property indicates if a given field in the autECLFieldList collection has a numeric input only attribute.
Numeric is a Boolean data type and is read-only. The following example shows this property.
HighIntensity
This collection element property indicates if a given field in the autECLFieldList collection has a high intensity attribute.
HighIntensity is a Boolean data type and is read-only. The following example shows this property.
PenDetectable
This collection element property indicates if a given field in the autECLFieldList collection has a pen detectable attribute.
PenDetectable is a Boolean data type and is read-only. The following example shows this property.
Display
This collection element property indicates whether a given field in the autECLFieldList collection has a display attribute.
Display is a Boolean data type and is read-only. The following example shows this property.
autECLFieldList Methods
The following section describes the methods that are valid for the autECLFieldList object.
void Refresh()
Object FindFieldByRowCol(Long Row, Long Col)
Object FindFieldByText(String text, [optional] Long Direction, [optional] Long StartRow,
[optional] Long StartCol)
The following collection element methods are valid for each item in the list.
String GetText()
void SetText(String Text)
Refresh
Note:
You should call the Refresh method before accessing the field collection to ensure that you have current field data.
Prototype
void Refresh()
Parameters
None
Return Value
None
Example
The following example shows how to get a snapshot of all the fields for a given presentation space.
FindFieldByRowCol
This method searches the autECLFieldList object for a field containing the given row and column coordinates. The value
returned is a collection element object in the autECLFieldList collection.
Prototype
Parameters
Long Row
Field row to search for.
Long Col
Field column to search for.
Return Value
Object
Dispatch object for the autECLFieldList collection item.
Example
The following example shows how to search the autECLFieldList object for a field containing the given row and column
coordinates.
' Build the list and search for field at row 2 col 1
autECLPSObj.autECLFieldList.Refresh(1)
Set FieldElement = autECLPSObj.autECLFieldList.FindFieldByRowCol( 2, 1 )
FieldElement.SetText("IBM")
FindFieldByText
This method searches the autECLFieldList object for a field containing the string passed in as Text. The value returned is a
collection element object in the autECLFieldList collection.
Prototype
Object FindFieldByText(String Text, [optional] Long Direction, [optional] Long StartRow, [optional] Long StartCol)
Parameters
String Text
Long StartRow
Row position in the presentation space at which to begin the search.
Long StartCol
Column position in the presentation space at which to begin the search.
Long Direction
Direction in which to search. Values are 1 for search forward, 2 for search backward
Return Value
Object
Dispatch object for the autECLFieldList collection item.
Example
The following example shows how to search the autECLFieldList object for a field containing the string passed in as text.
' Build the list and search for field with text
autECLPSObj.autECLFieldList.Refresh(1)
set FieldElement = autECLPSObj.autECLFieldList.FindFieldByText "IBM"
FieldElement.SetText("Hello.")
GetText
The collection element method GetText retrieves the characters of a given field in an autECLFieldList item.
Prototype
String GetText()
Parameters
None
Return Value
String
Field text.
Example
autECLPSObj.autECLFieldList.Refresh()
TextStr = autECLPSObj.autECLFieldList(1).GetText()
SetText
This method populates a given field in an autECLFieldList item with the character string passed in as text. If the text exceeds
the length of the field, the text is truncated.
Prototype
Parameters
String text
String to set in field
Return Value
None
Example
The following example shows how to populate the field in an autECLFieldList item with the character string passed in as text.
' Build the list and set the first field with some text
autECLPSObj.autECLFieldList.Refresh(1)
autECLPSObj.autECLFieldList(1).SetText("IBM is a cool company")
autECLOIA Class
The autECLOIA object retrieves status from the Host Operator Information Area. Its name in the registry is
PCOMM.autECLOIA.
You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle to
initialize your object. The connection may be set only once. After the connection is set, any further calls to the set connection
methods cause an exception. If you do not set the connection and try to access a property or method, an exception is also
raised.
Note:
The autECLOIA object in the autECLSession object is set by the autECLSession object.
The following example shows how to create and set the autECLOIA object in Visual Basic.
Properties
Alphanumeric
This property queries the operator information area to determine whether the field at the cursor location is alphanumeric.
Alphanumeric is a Boolean data type and is read-only. The following example shows this property.
If autECLOIA.Alphanumeric Then...
APL
This property queries the operator information area to determine whether the keyboard is in APL mode. APL is a Boolean
data type and is read-only. The following example shows this property.
Katakana
This property queries the operator information area to determine whether Katakana characters are enabled. Katakana is a
Boolean data type and is read-only. The following example shows this property.
Hiragana
This property queries the operator information area to determine whether Hiragana characters are enabled. Hiragana is a
Boolean data type and is read-only. The following example shows this property.
DBCS
This property queries the operator information area to determine whether the field at the cursor location is DBCS. DBCS is a
Boolean data type and is read-only. The following example shows this property.
UpperShift
This property queries the operator information area to determine whether the keyboard is in uppershift mode. Uppershift is a
Boolean data type and is read-only. The following example shows this property.
autECLConnList.Refresh
autECLOIA.SetConnectionByHandle(autECLConnList(1).Handle)
Numeric
This property queries the operator information area to determine whether the field at the cursor location is numeric. Numeric is
a Boolean data type and is read-only. The following example shows this property.
CapsLock
This property queries the operator information area to determine if the keyboard CapsLock key is on. CapsLock is a Boolean
data type and is read-only. The following example shows this property.
InsertMode
This property queries the operator information area to determine whether if the keyboard is in insert mode. InsertMode is a
Boolean data type and is read-only. The following example shows this property.
CommErrorReminder
This property queries the operator information area to determine whether a communications error reminder condition exists.
CommErrorReminder is a Boolean data type and is read-only. The following example shows this property.
MessageWaiting
This property queries the operator information area to determine whether the message waiting indicator is on. This can only
occur for 5250 connections. MessageWaiting is a Boolean data type and is read-only. The following example shows this
property.
InputInhibited
This property queries the operator information area to determine whether keyboard input is inhibited. InputInhibited is a Long
data type and is read-only. The following table shows valid values for InputInhibited.
Name Value
Not Inhibited 0
System Wait 1
Communication Check 2
Program Check 3
Machine Check 4
Other Inhibit 5
Name
This property is the connection name string of the connection for which autECLOIA was set. Personal Communications only
returns the short character ID (A-Z) in the string. There can be only one Personal Communications connection open with a
given name. For example, there can be only one connection "A" open at a time. Name is a String data type and is read-only.
The following example shows this property.
Handle
This is the handle of the connection for which the autECLOIA object was set. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Handle is a Long data type and is read-only. The following example shows this property.
ConnType
This is the connection type for which autECLOIA was set. This type may change over time. ConnType is a String data type
and is read-only. The following example shows this property.
CodePage
This is the code page of the connection for which autECLOIA was set. This code page may change over time. CodePage is
a Long data type and is read-only. The following example shows this property.
Started
This indicates whether the emulator window is started. The value is True if the window is open; otherwise, it is False. Started
is a Boolean data type and is read-only. The following example shows this property.
CommStarted
This indicates the status of the connection to the host. The value is True if the host is connected; otherwise, it is False.
CommStarted is a Boolean data type and is read-only. The following example shows this property.
APIEnabled
This indicates whether the emulator is API-enabled. A connection may be enabled or disabled depending on the state of its
API settings (in a Personal Communications window, choose File -> API Settings). The value is True if the emulator is
enabled; otherwise, it is False. APIEnabled is a Boolean data type and is read-only. The following example shows this
property.
Ready
This indicates whether the emulator window is started, API-enabled, and connected. This property checks for all three
properties. The value is True if the emulator is ready; otherwise, it is False. Ready is a Boolean data type and is read-only.
The following example shows this property.
NumLock
This property queries the operator information area to determine if the keyboard NumLock key is on. NumLock is a Boolean
data type and is read-only. The following example shows this property.
autECLOIA Methods
The following section describes the methods that are valid for autECLOIA.
void RegisterOIAEvent()
void UnregisterOIAEvent()
void SetConnectionByName (String Name)
void SetConnectionByHandle (Long Handle)
void StartCommunication()
void StopCommunication()
Boolean WaitForInputReady([optional] Variant TimeOut)
Boolean WaitForSystemAvailable([optional] Variant TimeOut)
Boolean WaitForAppAvailable([optional] Variant TimeOut)
Boolean WaitForTransition([optional] Variant Index, [optional] Variant timeout)
void CancelWaits()
RegisterOIAEvent
Prototype
void RegisterOIAEvent()
Parameters
None
Return Value
None
Example
UnregisterOIAEvent
Prototype
void UnregisterOIAEvent()
Parameters
None
Return Value
None
Example
SetConnectionByName
The SetConnectionByName method uses the connection name to set the connection for a newly created autECLOIA object.
In Personal Communications this connection name is the short connection ID (character A-Z). There can be only one
Personal Communications connection open with a given name. For example, there can be only one connection "A" open at a
time.
Note:
Do not call this if using the autECLOIA object in autECLSession.
Prototype
Parameters
String Name
One-character string short name of the connection (A-Z).
Return Value
None
Example
The following example shows how to use the connection name to set the connection for a newly created autECLOIA object.
SetConnectionByHandle
The SetConnectionByHandle method uses the connection handle to set the connection for a newly created autECLOIA
object. In Personal Communications this connection handle is a Long integer. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLOIA object in autECLSession.
Prototype
Parameters
Long Handle
Long integer value of the connection to be set for the object.
Return Value
None
Example
The following example shows how to use the connection handle to set the connection for a newly created autELCOIA object.
StartCommunication
The StartCommunication collection element method connects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Connect.
Prototype
void StartCommunication()
Parameters
None
Return Value
None
Example
None
OIAObj.StartCommunication()
StopCommunication
The StopCommunication collection element method disconnects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
Prototype
void StopCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
OIAObj.StopCommunication()
WaitForInputReady
The WaitForInputReady method waits until the OIA of the connection associated with the autECLOIA object indicates that the
connection is able to accept keyboard input.
Prototype
Parameters
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLOIAObj.SetConnectionByName("A")
if (autECLOIAObj.WaitForInputReady(10000)) then
else
end if
WaitForSystemAvailable
The WaitForSystemAvailable method waits until the OIA of the connection associated with the autECLOIA object indicates
that the connection is connected to a host system.
Prototype
Parameters
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLOIAObj.SetConnectionByName("A")
if (autECLOIAObj.WaitForSystemAvailable(10000)) then
else
end if
WaitForAppAvailable
The WaitForAppAvailable method waits while the OIA of the connection associated with the autECLOIA object indicates that
the application is being worked with.
Prototype
Parameters
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLOIAObj.SetConnectionByName("A")
else
end if
WaitForTransition
The WaitForTransition method waits for the OIA position specified of the connection associated with the autECLOIA object to
change.
Prototype
Parameters
Variant Index
The 1 byte Hex position of the OIA to monitor. This parameter is optional. The default is 3.
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
Dim Index
Index = 03h
autECLOIAObj.SetConnectionByName("A")
if (autECLOIAObj.WaitForTransition(Index,10000)) then
msgbox "Position " " Index " " of the OIA Changed"
else
end if
CancelWaits
Prototype
void CancelWaits()
Parameters
None
Return Value
None
autECLOIA Events
The following events are valid for autECLOIA:
void NotifyOIAEvent()
void NotifyOIAError()
void NotifyOIAStop(Long Reason)
NotifyOIAEvent
Prototype
void NotifyOIAEvent()
Parameters
None
Example
NotifyOIAError
Prototype
void NotifyOIAError()
Parameters
None
Example
NotifyOIAStop
Prototype
Parameters
Long Reason
Long Reason code for the stop. Currently, this will always be 0.
Option Explicit
sub main()
'Create Objects
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
'Clean up
myOIA.UnregisterOIAEvent
End Sub
End Sub
End Sub
autECLPS Class
autECLPS performs operations on a presentation space. Its name in the registry is PCOMM.autECLPS.
You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle to
initialize your object. The connection may be set only once. After the connection is set, any further calls to the SetConnection
methods cause an exception. If you do not set the connection and try to access a property or method, an exception is also
raised.
Notes:
1. In the presentation space, the first row coordinate is row 1 and the first column coordinate is column 1. Therefore, the
top, left position has a coordinate of row 1, column 1.
2. The autECLPS object in the autECLSession object is set by the autECLSession object.
The following is an example of how to create and set the autECLPS object in Visual Basic.
Properties
autECLFieldList
This is the field collection object for the connection associated with the autECLPS object. See autECLFieldList Class for
details. The following example shows this object.
NumRows
This is the number of rows in the presentation space for the connection associated with the autECLPS object. NumRows is a
Long data type and is read-only. The following example shows this property.
NumCols
This is the number of columns in the presentation space for the connection associated with the autECLPS object. NumCols is
a Long data type and is read-only. The following example shows this property.
CursorPosRow
This is the current row position of the cursor in the presentation space for the connection associated with the autECLPS
object. CursorPosRow is a Long data type and is read-only. The following example shows this property.
CursorPosCol
This is the current column position of the cursor in the presentation space for the connection associated with the autECLPS
object. CursorPosCol is a Long data type and is read-only. The following example shows this property.
Name
This is the connection name string of the connection for which autECLPS was set. Personal Communications only returns the
short character ID (A-Z) in the string. There can be only one Personal Communications connection open with a given name.
For example, there can be only one connection "A" open at a time. Name is a String data type and is read-only. The following
example shows this property.
Handle
This is the handle of the connection for which the autECLPS object was set. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Handle is a Long data type and is read-only. The following example shows this property.
ConnType
This is the connection type for which autECLPS was set. This connection type may change over time. ConnType is a String
data type and is read-only. The following example shows this property.
CodePage
This is the code page of the connection for which autECLPS was set. This code page may change over time. CodePage is a
Long data type and is read-only. The following example shows this property.
Started
This indicates if the connection emulator window is started. The value is True if the window is open; otherwise, it is False.
Started is a Boolean data type and is read-only. The following example shows this property.
CommStarted
This indicates the status of the connection to the host. The value is True if the host is connected; otherwise, it is False.
CommStarted is a Boolean data type and is read-only. The following example shows this property.
Obj.SetConnectionByName("A")
APIEnabled
This indicates if the emulator is API-enabled. A connection may be enabled or disabled depending on the state of its API
settings (in a Personal Communications window, choose File -> API Settings). The value is True if API is enabled; otherwise,
it is False. APIEnabled is a Boolean data type and is read-only. The following example shows this property.
Ready
This indicates whether the emulator window is started, API enabled and connected. This checks for all three properties. The
value is True if the emulator is ready; otherwise, it is False. Ready is a Boolean data type and is read-only. The following
example shows this property.
autECLPS Methods
The following section describes the methods that are valid for the autECLPS object.
void RegisterPSEvent()
void RegisterKeyEvent()
void RegisterCommEvent()
void UnregisterPSEvent()
void UnregisterKeyEvent()
void UnregisterCommEvent()
void SetConnectionByName (String Name)
RegisterPSEvent
This method registers an autECLPS object to receive notification of all changes to the PS of the connected session.
Prototype
void RegisterPSEvent()
Parameters
None
Return Value
None
Example
RegisterKeyEvent
Prototype
void RegisterKeyEvent()
Parameters
None
Return Value
None
Example
RegisterCommEvent
This method registers an object to receive notification of all communication link connect/disconnect events.
Prototype
void RegisterCommEvent()
Parameters
None
Return Value
None
Example
UnregisterPSEvent
Prototype
void UnregisterPSEvent()
Parameters
None
Return Value
None
Example
UnregisterKeyEvent
Prototype
void UnregisterKeyEvent()
Parameters
None
Return Value
None
Example
UnregisterCommEvent
Prototype
void UnregisterCommEvent()
Parameters
None
Return Value
None
SetConnectionByName
This method uses the connection name to set the connection for a newly created autECLPS object. In Personal
Communications this connection name is the short ID (character A-Z). There can be only one Personal Communications
connection open with a given name. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLPS object in autECLSession.
Prototype
Parameters
String Name
One-character string short name of the connection (A-Z).
Return Value
None
Example
The following example shows how to set the connection for a newly created autECLPS object using the connection name.
SetConnectionByHandle
This method uses the connection handle to set the connection for a newly created autECLPS object. In Personal
Communications this connection handle is a Long integer. There can be only one Personal Communications connection open
with a given handle. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLPS object in autECLSession.
Prototype
Parameters
Long Handle
Long integer value of the connection to be set for the object.
Return Value
None
Example
The following example shows how to set the connection for a newly created autECLPS object using the connection handle.
SetCursorPos
The SetCursorPos method sets the position of the cursor in the presentation space for the connection associated with the
autECLPS object. The position set is in row and column units.
Prototype
Parameters
Long Row
The row position of the cursor in the presentation space.
Long Col
The column position of the cursor in the presentation space.
Return Value
None
Example
The following example shows how to set the position of the cursor in the presentation space for the connection associated
with the autECLPS object.
SendKeys
The SendKeys method sends a string of keys to the presentation space for the connection associated with the autECLPS
object. This method allows you to send mnemonic keystrokes to the presentation space. See Appendix A, Sendkeys
Mnemonic Keywords for a list of these keystrokes.
Prototype
Parameters
String text
String of keys to send to the presentation space.
Long Row
Row position to send keys to the presentation space. This parameter is optional. The default is the current cursor row
position. If row is specified, col must also be specified.
Long Col
Column position to send keys to the presentation space. This parameter is optional. The default is the current cursor
column position. If col is specified, row must also be specified.
Return Value
None
Example
The following example shows how to use the SendKeys method to send a string of keys to the presentation space for the
connection associated with the autECLPS object.
SearchText
The SearchText method searches for the first occurrence of text in the presentation space for the connection associated with
the autECLPS object. The search is case-sensitive. If text is found, the method returns a TRUE value. It returns a FALSE
value if no text is found. If the optional row and column parameters are used, row and col are also returned, indicating the
position of the text if it was found.
Prototype
boolean SearchText(String text, [optional] Long Dir, [optional] Long Row, [optional] Long Col)
Parameters
String text
String to search for.
Long Dir
Direction in which to search. Must either be 1 for search forward or 2 for search backward. This parameter is optional. The
default is 1 for Forward.
Long Row
Row position at which to start the search in the presentation space. The row of found text is returned if the search is
successful. This parameter is optional. If row is specified, col must also be specified.
Long Col
Column position at which to start the search in the presentation space. The column of found text is returned if the search is
successful. This parameter is optional. If col is specified, row must also be specified.
Return Value
Example
The following example shows how to search for text in the presentation space for the connection associated with the
autECLPS object.
GetText
The GetText method retrieves characters from the presentation space for the connection associated with the autECLPS
object.
Prototype
String GetText([optional] Long Row, [optional] Long Col, [optional] Long LenToGet)
Parameters
Long Row
Row position at which to start the retrieval in the presentation space. This parameter is optional.
Long Col
Column position at which to start the retrieval in the presentation space. This parameter is optional.
Long LenToGet
Number of characters to retrieve from the presentation space. This parameter is optional. The default is the length of the
array passed in as BuffLen.
Return Value
String
Text from the PS.
Example
The following example shows how to retrieve a string from the presentation space for the connection associated with the
autECLPS object.
PSText = autECLPSObj.GetText(2,1,50)
SetText
The SetText method sends a string to the presentation space for the connection associated with the autECLPS object.
Although this method is similar to the SendKeys method, this method does not send mnemonic keystrokes (for example,
[enter] or [pf1]).
Prototype
Parameters
String Text
Character array to send.
Long Row
The row at which to begin the retrieval from the presentation space. This parameter is optional. The default is the current
cursor row position.
Long Col
The column position at which to begin the retrieval from the presentation space. This parameter is optional. The default is
the current cursor column position.
Return Value
None
Example
The following example shows how to search for text in the presentation space for the connection associated with the
autECLPS object.
GetTextRect
The GetTextRect method retrieves characters from a rectangular area in the presentation space for the connection
associated with the autECLPS object. No wrapping takes place in the text retrieval; only the rectangular area is retrieved.
Prototype
Parameters
Long StartRow
Row at which to begin the retrieval in the presentation space.
Long StartCol
Column at which to begin the retrieval in the presentation space.
Long EndRow
Row at which to end the retrieval in the presentation space.
Long EndCol
Column at which to end the retrieval in the presentation space.
Return Value
String
PS Text.
Example
The following example shows how to retrieve characters from a rectangular area in the presentation space for the connection
associated with the autECLPS object.
PSText = GetTextRect(1,1,2,80)
StartCommunication
The StartCommunication collection element method connects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Connect.
Prototype
void StartCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
PSObj.StartCommunication()
StopCommunication
The StopCommunication collection element method disconnects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
Prototype
void StopCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
PSObj.StopCommunication()
StartMacro
The StartMacro method runs the Personal Communications macro file indicated by the MacroName parameter.
Prototype
Parameters
String MacroName
Name of macro file located in the Personal Communications user-class application data directory (specified at installation),
without the file extension. This method does not support long file names.
Return Value
None
Usage Notes
You must use the short file name for the macro name. This method does not support long file names.
Example
Dim PS as Object
Set PS = CreateObject("PCOMM.autECLPS")
PS.StartMacro "mymacro"
Wait
The Wait method waits for the number of milliseconds specified by the milliseconds parameter
Prototype
Parameters
Long milliseconds
The number of milliseconds to wait.
Return Value
None
Example
WaitForCursor
The WaitForCursor method waits for the cursor in the presentation space of the connection associated with the autECLPS
object to be located at a specified position.
Prototype
Parameters
Variant Row
Row position of the cursor.
Variant Col
Column position of the cursor.
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
Row = 20
Col = 16
if (autECLPSObj.WaitForCursor(Row,Col,10000)) then
else
end if
WaitWhileCursor
The WaitWhileCursor method waits while the cursor in the presentation space of the connection associated with the
autECLPS object is located at a specified position.
Prototype
Parameters
Variant Row
Row position of the cursor.
Variant Col
Column position of the cursor.
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
Row = 20
Col = 16
if (autECLPSObj.WaitWhileCursor(Row,Col,10000)) then
msgbox "Cursor is no longer at " " Row " "," " Col
else
end if
WaitForString
The WaitForString method waits for the specified string to appear in the presentation space of the connection associated with
the autECLPS object. If the optional Row and Column parameters are used, the string must begin at the specified position. If
0,0 are passed for Row,Col the method searches the entire PS.
Prototype
Parameters
Variant WaitString
The string for which to wait.
Variant Row
Row position that the string will begin. This parameter is optional. The default is 0.
Variant Col
Column position that the string will begin. This parameter is optional. The default is 0.
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Boolean bCaseSens
If this value is True, the wait condition is verified as case-sensitive. This parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
Row = 20
Col = 16
if (autECLPSObj.WaitForString(WaitString,Row,Col,10000)) then
msgbox WaitString " " found at " " Row " "," " Col
else
end if
WaitWhileString
The WaitWhileString method waits while the specified string appears in the presentation space of the connection associated
with the autECLPS object. If the optional Row and Column parameters are used, the string must begin at the specified
position. If 0,0 are passed for Row,Col the method searches the entire PS.
Prototype
Parameters
Variant WaitString
The method waits while this string value exists.
Variant Row
Row position that the string will begin. This parameter is optional. The default is 0.
Variant Col
Column position that the string will begin. This parameter is optional. The default is 0.
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Boolean bCaseSens
If this value is True, the wait condition is verified as case-sensitive. This parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
Row = 20
Col = 16
if (autECLPSObj.WaitWhileString(WaitString,Row,Col,10000)) then
msgbox WaitString " " was found at " " Row " "," " Col
else
end if
WaitForStringInRect
The WaitForStringInRect method waits for the specified string to appear in the presentation space of the connection
associated with the autECLPS object in the specified rectangle.
Prototype
Parameters
Variant WaitString
The string for which to wait.
Variant sRow
Starting row position of the search rectangle.
Variant sCol
Starting column position of the search rectangle.
Variant eRow
Ending row position of the search rectangle.
Variant eCol
Variant nTimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Boolean bCaseSens
If this value is True, the wait condition is verified as case-sensitive. This parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
sRow = 20
sCol = 16
eRow = 21
eCol = 31
if (autECLPSObj.WaitForStringInRect(WaitString,sRow,sCol,eRow,eCol,10000)) then
else
end if
WaitWhileStringInRect
The WaitWhileStringInRect method waits while the specified string appears in the presentation space of the connection
associated with the autECLPS object in the specified rectangle.
Prototype
Parameters
Variant WaitString
The method waits while this string value exists.
Variant sRow
Starting row position of the search rectangle.
Variant sCol
Starting column position of the search rectangle.
Variant eRow
Ending row position of the search rectangle.
Variant eCol
Ending column position of the search rectangle.
Variant nTimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Boolean bCaseSens
If this value is True, the wait condition is verified as case-sensitive. This parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
sRow = 20
sCol = 16
eRow = 21
eCol = 31
if (autECLPSObj.WaitWhileStringInRect(WaitString,sRow,sCol,eRow,eCol,10000)) then
else
end if
WaitForAttrib
The WaitForAttrib method will wait until the specified Attribute value appears in the presentation space of the connection
associated with the autECLPS object at the specified Row/Column position. The optional MaskData parameter can be used
to control which values of the attribute you are looking for. The optional plane parameter allows you to select any of the four
PS planes.
Prototype
Parameters
Variant Row
Row position of the attribute.
Variant Col
Column position of the attribute.
Variant WaitData
The 1-byte HEX value of the attribute to wait for.
Variant MaskData
The 1-byte HEX value to use as a mask with the attribute. This parameter is optional. The default value is 0xFF.
Variant plane
The plane of the attribute to get. The plane can have the following values:
1
Text Plane
2
Color Plane
3
Field Plane (default)
4
Extended Field Plane
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
Row = 20
Col = 16
WaitData = E8h
MaskData = FFh
plane = 3
else
end if
WaitWhileAttrib
The WaitWhileAttrib method waits while the specified Attribute value appears in the presentation space of the connection
associated with the autECLPS object at the specified Row/Column position. The optional MaskData parameter can be used
to control which values of the attribute you are looking for. The optional plane parameter allows you to select any of the four
PS planes.
Prototype
Parameters
Variant Row
Row position of the attribute.
Variant Col
Column position of the attribute.
Variant WaitData
The 1 byte HEX value of the attribute to wait for.
Variant MaskData
The 1 byte HEX value to use as a mask with the attribute. This parameter is optional. The default value is 0xFF.
Variant plane
The plane of the attribute to get. The plane can have the following values:
1
Text Plane
2
Color Plane
3
Field Plane (default)
4
Extended Field Plane
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Boolean bWaitForIr
If this value is true, after meeting the wait condition the function will wait until the OIA is ready to accept input. This
parameter is optional. The default is False.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
Row = 20
Col = 16
WaitData = E8h
MaskData = FFh
plane = 3
else
end if
WaitForScreen
Synchronously waits for the screen described by the autECLScreenDesc parameter to appear in the Presentation Space.
Note:
The wait for OIA input flag is set on the autECLScreenDesc object, it is not passed as a parameter to the wait method.
Prototype
Parameters
Object screenDesc
autECLScreenDesc object that describes the screen (see autECLScreenDesc Class).
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
autECLScreenDesObj.AddCursorPos 23, 1
else
end if
WaitWhileScreen
Synchronously waits until the screen described by the autECLScreenDesc parameter is no longer in the Presentation Space.
Note:
The wait for OIA input flag is set on the autECLScreenDesc object, it is not passed as a parameter to the wait method.
Prototype
Parameters
Object ScreenDesc
autECLScreenDesc object that describes the screen (see autECLScreenDesc Class).
Variant TimeOut
The maximum length of time in milliseconds to wait, this parameter is optional. The default is Infinite.
Return Value
The method returns True if the condition is met, or False if the Timeout value is exceeded.
Example
autECLPSObj.SetConnectionByName("A")
autECLScreenDesObj.AddCursorPos 23, 1
else
end if
CancelWaits
Prototype
void CancelWaits()
Parameters
None
Return Value
None
autECLPS Events
The following events are valid for autECLPS:
void NotifyPSEvent()
void NotifyKeyEvent(string KeyType, string KeyString, PassItOn as Boolean)
void NotifyCommEvent(boolean bConnected)
void NotifyPSError()
void NotifyKeyError()
void NotifyCommError()
void NotifyPSStop(Long Reason)
void NotifyKeyStop(Long Reason)
void NotifyCommStop(Long Reason)
NotifyPSEvent
Prototype
void NotifyPSEvent()
Parameters
None
Example
NotifyKeyEvent
A keystroke event has occurred and the key information has been supplied. This function can be used to intercept keystrokes
to a given PS. The Key information is passed to the event handler and can be passed on, or another action can be
performed.
Note:
Only one object can have keystroke event handling registered to a given PS at a time.
Prototype
Parameters
String KeyType
Type of key intercepted.
M
Mnemonic keystroke
A
ASCII
String KeyString
Intercepted keystroke
Boolean PassItOn
Flag to indicate if the keystroke should be echoed to the PS.
TRUE
FALSE
Prevents the keystroke from being passed to the PS.
Example
NotifyCommEvent
Prototype
Parameters
boolean bConnected
True if Communications Link is currently Connected, False otherwise.
Example
NotifyPSError
Prototype
void NotifyPSError()
Parameters
None
Example
NotifyKeyError
Prototype
void NotifyKeyError()
Parameters
None
Example
NotifyCommError
Prototype
void NotifyCommError()
Parameters
None
Example
NotifyPSStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently this will always be 0.
Example
NotifyKeyStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently this will always be 0.
Example
NotifyCommStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently this will always be 0.
Option Explicit
sub main()
'Create Objects
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
mPS.UnregisterPSEvent
mPS.UnregisterCommEvent
mkey.UnregisterKeyEvent
End Sub
'This sub will get called when the PS of the Session registered
'above changes
End Sub
'This sub will get called when Keystrokes are entered into Session B
mkey.SendKeys "[PF2]"
end if
end if
End Sub
End Sub
End Sub
End Sub
End Sub
'This sub will get called when the Communication Link Status of the registered
'connection changes
End Sub
End Sub
End Sub
autECLScreenDesc Class
autECLScreenDesc is the class that is used to describe a screen for IBM's Host Access Class Library Screen Recognition
Technology. It uses all four major planes of the presentation space to describe it (text, field, extended field, and color planes),
as well as the cursor position.
Using the methods provided on this object, the programmer can set up a detailed description of what a given screen looks
like in a host side application. Once an autECLScreenDesc object is created and set, it may be passed to either the
synchronous WaitFor... methods provided on autECLPS, or it may be passed to autECLScreenReco, which fires an
asynchronous event if the screen matching the autECLScreenDesc object appears in the PS.
autECLScreenDesc Methods
The following section describes the methods that are valid for autECLScreenDesc.
AddAttrib
Prototype
Parameters
Variant attrib
The 1 byte HEX value of the attribute.
Variant row
Row position.
Variant col
Column position.
Variant plane
The plane of the attribute to get. The plane can have the following values:
0. All Planes
1. Text Plane
2. Color Plane
3. Field Plane
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
AddCursorPos
Sets the cursor position for the screen description to the given position.
Prototype
Parameters
Variant row
Row position.
Variant col
Column position.
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
AddNumFields
Prototype
Parameters
Variant num
Number of fields.
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
AddNumInputFields
Prototype
Parameters
Variant num
Number of input fields.
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
AddOIAInhibitStatus
Prototype
Parameters
Variant type
Type of OIA status. Valid values are as follows:
0. Don't Care
1. Not Inhibited
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
AddString
Prototype
void AddString(String str, Variant row, Variant col, [optional] Boolean caseSense)
Parameters
String str
String to add.
Variant row
Row position.
Variant col
Column position.
Boolean caseSense
If this value is True, the strings are added as case-sensitive. This parameter is optional. The default is True.
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
AddStringInRect
Prototype
Parameters
String str
String to add
Variant sRow
Upper left row position.
Variant sCol
Upper left column position.
Variant eRow
Lower right row position.
Variant eCol
Lower right column position.
Variant caseSense
If this value is True, the strings are added as case-sensitive. This parameter is optional. The default is True.
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
Clear
Prototype
void Clear()
Parameters
None
Return Value
None
Example
autECLPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddCursorPos 23,1
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
else
end if
autECLScreenReco Class
The autECLScreenReco class is the engine for the Host Access Class Library screen recognition system. It contains the
methods for adding and removing descriptions of screens. It also contains the logic for recognizing those screens and for
asynchronously calling back to your event handler code for those screens.
Think of an object of the autECLScreenReco class as a unique recognition set. The object can have multiple autECLPS
objects that it watches for screens, and multiple screens to look for, and when it sees a registered screen in any of the added
autECLPS objects it will fire event handling code defined in your application.
All you need to do is set up your autECLScreenReco objects at the start of your application, and when any screen appears in
any autECLPS that you want to monitor, your event code will get called by autECLScreenReco. You do absolutely no legwork
in monitoring screens.
autECLScreenReco Methods
The following section describes the methods that are valid for autECLScreenReco.
void AddPS(autECLPS ps)
Boolean IsMatch(autECLPS ps, AutECLScreenDesc sd)
void RegisterScreen(AutECLScreenDesc sd)
AddPS
Prototype
Parameters
autECLPS ps
PS object to monitor.
Return Value
None
Example
IsMatch
Allows for passing an autECLPS object and an AutECLScreenDesc object and determining if the screen description matches
the current state of the PS. The screen recognition engine uses this logic, but is provided so any routine can call it.
Prototype
Parameters
autECLPS ps
autPS object to compare.
AutECLScreenDesc sd
autECLScreenDesc object to compare.
Return Value
True if the AutECLScreenDesc object matches the current screen in the PS, False otherwise.
Example
autPSObj.SetConnectionByName "A"
autECLScreenDesObj.AddCursorPos 23, 1
autECLScreenDesObj.AddAttrib E8h, 1, 1, 2
autECLScreenDesObj.AddNumFields 45
autECLScreenDesObj.AddNumInputFields 17
autECLScreenDesObj.AddOIAInhibitStatus 1
msgbox "matched"
else
end if
RegisterScreen
Begins monitoring all autECLPS objects added to the screen recognition object for the given screen description. If the
screen appears in the PS, a NotifyRecoEvent will occur.
Prototype
Parameters
AutECLScreenDesc sd
Screen description object to register.
Return Value
None
Example
RemovePS
Prototype
Parameters
autECLPS ps
autECLPS object to remove.
Return Value
None
Example
UnregisterScreen
Prototype
Parameters
AutECLScreenDesc sd
Screen description object to remove.
Return Value
None
Example
autECLScreenReco Events
The following events are valid for autECLScreenReco:
void NotifyRecoEvent(AutECLScreenDesc sd, autECLPS ps)
void NotifyRecoError()
void NotifyRecoStop(Long Reason)
NotifyRecoEvent
This event occurs when a Registered Screen Description appears in a PS that was added to the autECLScreenReco object.
Prototype
Parameters
AutECLScreenDesc sd
Screen Description object that had its criteria met.
autECLPS ps
PS object in which the match occurred.
Example
NotifyRecoError
Prototype
void NotifyRecoError()
Parameters
None
Example
NotifyRecoStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently this will always be 0.
Sub Main()
myScreenDesc = CreateObject("PCOMM.autECLScreenDesc")
myPS.SetConnectionByName "A"
myScreenDesc.AddCursorPos 23, 1
myScreenDesc.AddString "LOGON"
myScreenDesc.AddNumFields 59
' Add the PS to the reco object (can add multiple PS's)
reco.addPS myPS
reco.RegisterScreen myScreenDesc
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
' Clean up
reco.UnregisterScreen myScreenDesc
reco.RemovePS myPS
End Sub
'This sub will get called when the screen Description registered above appears in
If (reco.IsMatch(PS,myScreenDesc)) Then
End If
End Sub
Sub reco_NotifyRecoError
End sub
End sub
autECLSession Class
The autECLSession object provides general emulator related services and contains pointers to other key objects in the Host
Access Class Library. Its name in the registry is PCOMM.autECLSession.
Although the objects that autECLSession contains are capable of standing on their own, pointers to them exist in the
autECLSession class. When an autECLSession object is created, autECLPS, autECLOIA, autECLXfer,
autECLWindowMetrics, autECLPageSettings, and autECLPrinterSettings objects are also created. Refer to them as you
would any other property.
Notes:
1. The current version of this object is 1.2. There are two versions of this object; their ProgIDs in the registry are
PCOMM.autECLSession.1 and PCOMM.autECLSession.2. The version-independent ProgID is
PCOMM.autECLSession. The PCOMM.autECLSession.1 object does not support the properties
autECLPageSettings and autECLPrinterSettings.
2. You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle
to initialize your object. The connection can be set only once. After the connection is set, any further calls to the
SetConnection methods cause an exception. If you do not set the connection and try to access an autECLSession
property or method, an exception is also raised.
The following example shows how to create and set the autECLSession object in Visual Basic.
Properties
Name
This property is the connection name string of the connection for which autECLSession was set. Personal Communications
only returns the short character ID (A-Z) in the string. There can be only one Personal Communications connection open with
a given name. For example, there can be only one connection "A" open at a time. Name is a String data type and is read-only.
The following example shows this property.
Handle
This is the handle of the connection for which the autECLSession object was set. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Handle is a Long data type and is read-only. The following example shows this property.
ConnType
This is the connection type for which autECLXfer was set. This type may change over time. ConnType is a String data type
and is read-only. The following example shows this property.
CodePage
This is the code page of the connection for which autECLXfer was set. This code page may change over time. CodePage is
a Long data type and is read-only. The following example shows this property.
Started
This indicates whether the emulator window is started. The value is True if the window is open; otherwise, it is False. Started
is a Boolean data type and is read-only. The following example shows this property.
CommStarted
This indicates the status of the connection to the host. The value is True if the host is connected; otherwise, it is False.
CommStarted is a Boolean data type and is read-only. The following example shows this property.
APIEnabled
This indicates whether the emulator is API-enabled. A connection may be enabled or disabled depending on the state of its
API settings (in a Personal Communications window, choose File -> API Settings). The value is True if the emulator is
enabled; otherwise, it is False. APIEnabled is a Boolean data type and is read-only. The following example shows this
property.
Ready
This indicates whether the emulator window is started, API-enabled, and connected. This property checks for all three
properties. The value is True if the emulator is ready; otherwise, it is False. Ready is a Boolean data type and is read-only.
The following example shows this property.
autECLPS object
The autECLPS object allows you to access the methods contained in the PCOMM.autECLPS class. See autECLPS Class for
more information. The following example shows this object.
autECLOIA object
The autECLOIA object allows you to access the methods contained in the PCOMM.autECLOIA class. See autECLOIA Class
for more information. The following example shows this object.
autECLXfer object
The autECLXfer object allows you to access the methods contained in the PCOMM.autECLXfer class. See autECLXfer
Class for more information. The following example shows this object.
autECLWinMetrics object
The autECLWinMetrics object allows you to access the methods contained in the PCOMM.autECLWinMetrics class. See
autECLWinMetrics Class for more information. The following example shows this object.
autECLPageSettings object
The autECLPageSettings object enables you to access the methods contained in the PCOMM.autECLPageSettings class.
See autECLPageSettings Class for more information.
The autECLPageSettings object is also supported in VBSCRIPT. The following example shows how to use VBSCRIPT.
sub test_()
autECLSession.SetConnectionByName(ThisSessionName)
autECLSession.autECLPageSettings.FaceName="Courier"
end sub
autECLPrinterSettings object
The autECLPrinterSettings object enables you to access the methods contained in the PCOMM.autECLPrinterSettings class.
See autECLPageSettings Class for more information.
The autECLPrinterSettings object is also supported in VBSCRIPT. The following example shows how to use VBSCRIPT.
sub test_()
autECLSession.SetConnectionByName(ThisSessionName)
autECLSession.autECLPrinterSettings.SetWinDefaultPrinter
end sub
autECLSession Methods
The following section describes the methods that are valid for the autECLSession object.
void RegisterSessionEvent(Long updateType)
void RegisterCommEvent()
void UnregisterSessionEvent()
void UnregisterCommEvent()
void SetConnectionByName (String Name)
void SetConnectionByHandle (Long Handle)
void StartCommunication()
void StopCommunication()
RegisterSessionEvent
This method registers an autECLSession object to receive notification of specified Session events.
Note:
Prototype
Parameters
Long updateType
Type of update to monitor for:
1. PS Update
2. OIA Update
3. PS or OIA Update
Return Value
None
Example
RegisterCommEvent
This method registers an object to receive notification of all communication link connect/disconnect events.
Prototype
void RegisterCommEvent()
Parameters
None
Return Value
None
Example
UnregisterSessionEvent
Note:
This method is not supported and is not recommended for use.
Prototype
void UnregisterSessionEvent()
Parameters
None
Return Value
None
Example
UnregisterCommEvent
Prototype
void UnregisterCommEvent()
Parameters
None
Return Value
None
Example
SetConnectionByName
This method uses the connection name to set the connection for a newly created autECLSession object. In Personal
Communications this connection name is the short ID (character A-Z). There can be only one Personal Communications
connection open with a given name. For example, there can be only one connection "A" open at a time.
Prototype
Parameters
String Name
One-character string short name of the connection (A-Z).
Return Value
None
Example
The following example shows how to use the connection name to set the connection for a newly created autECLSession
object.
SetConnectionByHandle
This method uses the connection handle to set the connection for a newly created autECLSession object. In Personal
Communications this connection handle is a long integer. There can be only one Personal Communications connection open
with a given handle. For example, there can be only one connection "A" open at a time.
Prototype
Parameters
Long Handle
Return Value
None
Example
The following example shows how to use the connection handle to set the connection for a newly created autECLSession
object.
StartCommunication
The StartCommunication collection element method connects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Connect.
Prototype
void StartCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
SessObj.StartCommunication()
StopCommunication
The StopCommunication collection element method disconnects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
Prototype
void StopCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
SessObj.StopCommunication()
autECLSession Events
The following events are valid for autECLSession:
void NotifyCommEvent(boolean bConnected)
void NotifyCommError()
void NotifyCommStop(Long Reason)
NotifyCommEvent
Prototype
Parameters
boolean bConnected
TRUE if communications link is currently connected. FALSE otherwise.
Example
NotifyCommError
Prototype
void NotifyCommError()
Parameters
None
Example
NotifyCommStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently, this will always be 0.
Option Explicit
sub main()
'Create Objects
mSess.SetConnectionByName "A"
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
mSess.UnregisterCommEvent
End Sub
'This sub will get called when the Communication Link Status of the registered
'connection changes
End Sub
End Sub
End Sub
autECLWinMetrics Class
The autECLWinMetrics object performs operations on an emulator window. It allows you to perform window rectangle and
position manipulation (for example, SetWindowRect, Ypos and Width), as well as window state manipulation (for example,
Visible or Restored). Its name in the registry is PCOMM.autECLWinMetrics.
You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle to
initialize your object. The connection may be set only once. After the connection is set, any further calls to the set connection
methods cause an exception. If you do not set the connection and try to access a property or method, an exception is also
raised.
Note:
The autECLSession object in the autECL object is set by the autECL object.
The following example shows how to create and set the autECLWinMetrics object in Visual Basic.
Properties
WindowTitle
This is the title that is currently in the title bar for the connection associated with the autECLWinMetrics object. This property
may be both changed and retrieved. WindowTitle is a String data type and is read/write enabled. The following example
shows this process. The following example shows this property.
' or...
Usage Notes
If WindowTitle is set to blank, the window title of the connection is restored to its original setting.
Xpos
This is the x position of the upper left point of the emulator window rectangle. This property may be both changed and
retrieved. Xpos is a Long data type and is read/write enabled. However, if the connection you are attached to is an inplace,
embedded object, this property is read-only. The following example shows this property.
' or...
Ypos
This is the y position of the upper left point of the emulator window rectangle. This property may be both changed and
retrieved. Ypos is a Long data type and is read/write enabled. However, if the connection you are attached to is an inplace,
embedded object, this property is read-only. The following example shows this property.
' or...
Width
This is the width of the emulator window rectangle. This property may be both changed and retrieved. Width is a Long data
type and is read/write enabled. However, if the connection you are attached to is an inplace, embedded object, this property is
read-only. The following example shows this property.
' or...
Height
This is the height of the emulator window rectangle. This property may be both changed and retrieved. Height is a Long data
type and is read/write enabled. However, if the connection you are attached to is an inplace, embedded object, this property is
read-only. The following example shows this property.
' or...
Visible
This is the visibility state of the emulator window. This property may be both changed and retrieved. Visible is a Boolean data
type and is read/write enabled. However, if the connection you are attached to is an inplace, embedded object, this property is
read-only. The following example shows this property.
Active
This is the focus state of the emulator window. This property may be both changed and retrieved. Active is a Boolean data
type and is read/write enabled. However, if the connection you are attached to is an inplace, embedded object, this property is
read-only. The following example shows this property.
Minimized
This is the minimize state of the emulator window. This property may be both changed and retrieved. Minimized is a Boolean
data type and is read/write enabled. However, if the connection you are attached to is an inplace, embedded object, this
property is read-only. The following example shows this property.
Maximized
This is the maximize state of the emulator window. This property may be both changed and retrieved. Maximized is a Boolean
data type and is read/write enabled. However, if the connection you are attached to is an inplace, embedded object, this
property is read-only. The following example shows this property.
Restored
This is the restore state of the emulator window. Restored is a Boolean data type and is read/write enabled. However, if the
connection you are attached to is an inplace, embedded object, this property is read-only. The following example shows this
property.
Name
This property is the connection name string of the connection for which autECLWinMetrics was set. Currently, Personal
Communications only returns the short character ID (A-Z) in the string. There can be only one Personal Communications
connection open with a given name. For example, there can be only one connection "A" open at a time. Name is a String data
type and is read-only. The following example shows this property.
Handle
This is the handle of the connection for which the autECLWinMetrics object was set. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Handle is a Long data type and is read-only. The following example shows this property.
ConnType
This is the connection type for which autECLWinMetrics was set. This type may change over time. ConnType is a String data
type and is read-only. The following example shows this property.
Type = Obj.ConnType
CodePage
This is the code page of the connection for which autECLWinMetrics was set. This code page may change over time.
CodePage is a Long data type and is read-only. The following example shows this property.
Started
This indicates whether the emulator window is started. The value is True if the window is open; otherwise, it is False. Started
is a Boolean data type and is read-only. The following example shows this property.
CommStarted
This indicates the status of the connection to the host. The value is True if the host is connected; otherwise, it is False.
CommStarted is a Boolean data type and is read-only. The following example shows this property.
CommConn.Text = "Yes"
End If
APIEnabled
This indicates whether the emulator is API-enabled. A connection may be enabled or disabled depending on the state of its
API settings (in a Personal Communications window, choose File ->API Settings). The value is True if the emulator is
enabled; otherwise, it is False. APIEnabled is a Boolean data type and is read-only. The following example shows this
property.
Ready
This indicates whether the emulator window is started, API enabled, and connected. This property checks for all three
properties. The value is True if the emulator is ready; otherwise, it is False. Ready is a Boolean data type and is read-only.
The following example shows this property.
autECLWinMetrics Methods
The following section describes the methods that are valid for the autECLWinMetrics object.
void RegisterCommEvent()
void UnregisterCommEvent()
void SetConnectionByName(String Name)
void SetConnectionByHandle(Long Handle)
void GetWindowRect(Variant Left, Variant Top, Variant Right, Variant Bottom)
void SetWindowRect(Long Left, Long Top, Long Right, Long Bottom)
void StartCommunication()
void StopCommunication()
RegisterCommEvent
This method registers an object to receive notification of all communication link connect/disconnect events.
Prototype
void RegisterCommEvent()
Parameters
None
Return Value
None
Example
UnregisterCommEvent
Prototype
void UnregisterCommEvent()
Parameters
None
Return Value
None
SetConnectionByName
This method uses the connection name to set the connection for a newly created autECLWinMetrics object. In Personal
Communications this connection name is the short ID (character A-Z). There can be only one Personal Communications
connection open with a given name. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLWinMetrics object in autECLSession.
Prototype
Parameters
String Name
One-character string short name of the connection (A-Z).
Return Value
None
Example
The following example shows how to use the connection name to set the connection for a newly created autECLWinMetrics
object.
SetConnectionByHandle
This method uses the connection handle to set the connection for a newly created autECLWinMetrics object. In Personal
Communications this connection handle is a long integer. There can be only one Personal Communications connection open
with a given handle. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLWinMetrics object in autECLSession.
Prototype
Parameters
Long Handle
Long integer value of the connection to be set for the object.
Return Value
None
Example
The following example shows how to use the connection handle to set the connection for a newly created autECLWinMetrics
object.
GetWindowRect
The GetWindowRect method returns the bounding points of the emulator window rectangle.
Prototype
Parameters
Return Value
None
Example
The following example shows how to return the bounding points of the emulator window rectangle.
Dim left
Dim top
Dim right
Dim bottom
Set autECLWinObj = CreateObject("PCOMM.autECLWinMetrics")
Set ConnList = CreateObject("PCOMM.autECLConnList")
SetWindowRect
The SetWindowRect method sets the bounding points of the emulator window rectangle.
Prototype
Parameters
Return Value
None
Example
The following example shows how to set the bounding points of the emulator window rectangle.
StartCommunication
The StartCommunication collection element method connects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Connect.
Prototype
void StartCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
WinObj.StartCommunication()
StopCommunication
The StopCommunication collection element method disconnects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
Prototype
void StopCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
WinObj.StopCommunication()
NotifyCommEvent
Prototype
Parameters
boolean bConnected
True if Communications Link is currently Connected, False otherwise.
Example
NotifyCommError
Prototype
NotifyCommError()
Parameters
None
Example
NotifyCommStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently this will always be 0.
Option Explicit
sub main()
'Create Objects
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
mWmet.UnregisterCommEvent
End Sub
'This sub will get called when the Communication Link Status of the registered
'connection changes
End Sub
End Sub
End Sub
autECLXfer Class
The autECLXfer object provides file transfer services. Its name in the registry is PCOMM.autECLXfer.
You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle to
initialize your object. The connection may be set only once. After the connection is set, any further calls to the SetConnection
methods cause an exception. If you do not set the connection and try to access an autECLXfer property or method, an
exception is also raised. The following shows how to create and set the autECLXfer object in Visual Basic.
Properties
Name
This property is the connection name string of the connection for which autECLXfer was set. Personal Communications only
returns the short character ID (A-Z) in the string. There can be only one Personal Communications connection open with a
given name. For example, there can be only one connection "A" open at a time. Name is a String data type and is read-only.
The following example shows this property.
Handle
This is the handle of the connection for which the autECLXfer object was set. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Handle is a Long data type and is read-only. The following example shows this property.
ConnType
This is the connection type for which autECLXfer was set. This type may change over time. Conntype is a String data type
and is read-only. The following example shows this property.
CodePage
This is the code page of the connection for which autECLXfer was set. This code page may change over time. CodePage is
a Long data type and is read-only. The following example shows this property.
Started
This indicates whether the emulator window is started. The value is True if the window is open; otherwise, it is False. Started
is a Boolean data type and is read-only. The following example shows this property.
CommStarted
This indicates the status of the connection to the host. The value is True if the host is connected; otherwise, it is False.
CommStarted is a Boolean data type and is read-only. The following example shows this property.
APIEnabled
This indicates whether the emulator is API-enabled. A connection may be enabled or disabled depending on the state of its
API settings (in a Personal Communications window, choose File -> API Settings). The value is True if the emulator is
enabled; otherwise, it is False. APIEnabled is a Boolean data type and is read-only. The following example shows this
property.
Ready
This indicates whether the emulator window is started, API enabled, and connected. This property checks for all three
properties. The value is True if the emulator is ready; otherwise, it is False. Ready is a Boolean data type and is read-only.
The following example shows this property.
autECLXfer Methods
The following section describes the methods that are valid for the autECLXfer object.
void RegisterCommEvent()
void UnregisterCommEvent()
void SetConnectionByName(String Name)
void SetConnectionByHandle(Long Handle)
void SendFile(String PCFile, String HostFile, String Options)
void ReceiveFile(String PCFile, String HostFile, String Options)
void StartCommunication()
void StopCommunication()
RegisterCommEvent
This method registers an object to receive notification of all communication link connect/disconnect events.
Prototype
void RegisterCommEvent()
Parameters
None
Return Value
None
Example
UnregisterCommEvent
Prototype
void UnregisterCommEvent()
Parameters
None
Return Value
None
SetConnectionByName
The SetConnectionByName method uses the connection name to set the connection for a newly created autECLXfer object.
In Personal Communications this connection name is the short ID (character A-Z). There can be only one Personal
Communications connection open with a given name. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLXfer object in autECLSession.
Prototype
Parameters
String Name
One-character string short name of the connection (A-Z).
Return Value
None
Example
The following example shows how to use the connection name to set the connection for a newly created autECLXfer object.
SetConnectionByHandle
The SetConnectionByHandle method uses the connection handle to set the connection for a newly created autECLXfer
object. In Personal Communications this connection handle is a Long integer. There can be only one Personal
Communications connection open with a given handle. For example, there can be only one connection "A" open at a time.
Note:
Do not call this if using the autECLXfer object in autECLSession.
Prototype
Parameters
Long Handle
Long integer value of the connection to be set for the object.
Return Value
None
Example
The following example shows how to use the connection handle to set the connection for a newly created autECLXfer object.
' Initialize the connection with the first connection in the list
autECLConnList.Refresh
XferObj.SetConnectionByHandle(autECLConnList(1).Handle)
SendFile
The SendFile method sends a file from the workstation to the host for the connection associated with the autECLXfer object.
Prototype
Parameters
String PCFile
Name of the file on the workstation.
String HostFile
Name of the file on the host.
String Options
Host-dependent transfer options. See Usage Notes for more information.
Return Value
None
Usage Notes
File transfer options are host-dependent. The following is a list of some of the valid host options for a VM/CMS host.
ASCII
CRLF
APPEND
LRECL
RECFM
CLEAR/NOCLEAR
PROGRESS
QUIET
Refer to Emulator Programming for the list of supported hosts and associated file transfer options.
Example
The following example shows how to send a file from the workstation to the host for the connection associated with the
autECLXfer object.
' Initialize the connection with the first connection in the autECLConnList
autECLConnList.Refresh
XferObj.SetConnectionByHandle(autECLConnList(1).Handle)
ReceiveFile
The ReceiveFile method receives a file from the host to the workstation for the connection associated with the autECLXfer
object.
Prototype
Parameters
String PCFile
Name of the file on the workstation.
String HostFile
Name of the file on the host.
String Options
Host-dependent transfer options. See Usage Notes for more information.
Return Value
None
Usage Notes
File transfer options are host-dependent. The following is a list of some of the valid host options for a VM/CMS host:
ASCII
CRLF
APPEND
LRECL
RECFM
CLEAR/NOCLEAR
PROGRESS
QUIET
Refer to Emulator Programming manual for the list of supported hosts and associated file transfer options.
Example
The following example shows how to receive a file from the host and send it to the workstation for the connection associated
with the autECLXfer object.
' Initialize the connection with the first connection in the list
autECLConnList.Refresh
XferObj.SetConnectionByHandle(autECLConnList(1).Handle)
' For example, send the file to VM
XferObj.ReceiveFile "c:\windows\temp\thefile.txt",
"THEFILE TEXT A0",
"CRLF ASCII"
StartCommunication
The StartCommunication collection element method connects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Connect.
Prototype
void StartCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
XObj.StartCommunication()
StopCommunication
The StopCommunication collection element method disconnects the PCOMM emulator to the host data stream. This has the
same effect as going to the PCOMM emulator Communication menu and choosing Disconnect.
Prototype
void StopCommunication()
Parameters
None
Return Value
None
Example
The following example shows how to connect a PCOMM emulator session to the host.
SessObj.StopCommunication()
autECLXfer Events
The following events are valid for autECLXfer:
void NotifyCommEvent(boolean bConnected)
NotifyCommError()
void NotifyCommStop(Long Reason)
NotifyCommEvent
Prototype
Parameters
boolean bConnected
True if Communications Link is currently Connected, False otherwise.
Example
NotifyCommError
Prototype
NotifyCommError()
Parameters
None
Example
NotifyCommStop
Prototype
Parameters
Long Reason
Reason code for the stop. Currently this will always be 0.
Option Explicit
sub main()
'Create Objects
' Display your form or whatever here (this should be a blocking call, otherwise sub just ends
call DisplayGUI()
mXfer.UnregisterCommEvent
End Sub
'This sub will get called when the Communication Link Status of the registered
'connection changes
End Sub
End Sub
End Sub
autSystem Class
The autSystem class is used to perform utility operations that are not present in some programming languages.
autSystem Methods
The following section describes the methods that are valid for the autSystem object.
Long Shell(VARIANT ExeName, VARIANT Parameters, VARIANT WindowStyle)
String Inputnd()
Shell
Prototype
Parameters
VARIANT ExeName
Full path and file name of the executable file.
VARIANT Parameters
Any parameters to pass to the executable file. This parameter is optional.
VARIANT WindowStyle
The initial window style to show as executable. This parameter is optional and can have the following values:
1. Normal with focus (default)
2. Minimized with focus
3. Maximized
4. Normal without focus
5. Minimized without focus
Return Value
Example
End if
Inputnd
The Inputnd method displays a popup input box to the user with a no-display text box so that when the user types in data only
asterisks(*) are displayed.
Prototype
String Inputnd()
Parameters
None
Return Value
The characters typed into the input box, or "" if nothing was typed in.
Example
DIM strPassWord
dim SysObj as Object
dim PSObj as Object
PSObj.SetConnectionByName("A")
'Prompt user for password
strPassWord = SysObj.Inputnd()
PSObj.SetText(strPasssWord)
DIM XferObj as Object
autECLPageSettings Class
The autECLPageSettings object controls the page settings of a Personal Communications connection. Its name in the
registry is Personal Communications.autECLPageSettings. This automation object can also be used in VB scripts.
The read-only property autECLPageSettings has been added to the autECLSession object. See autECLSession Class for
information about how to use this property.
Note:
The autECLPageSettings object in the autECLSession object is set by the autECLSession object.
The following example shows how to create and set the autECLPageSettings object in Visual Basic.
Usage Notes
You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle to
initialize your object. The connection can be set only once. After the connection is set, any further calls to the set connection
methods cause an exception. If you do not set the connection and try to access a property or method, an exception is raised.
The properties CPI, LPI, and FontSize are dependent on the property FaceName. Therefore, if CPI, LPI, or FontSize are set
before the FaceName is set, and if they are not valid for the new FaceName, different CPI, LPI, or FontSize values might be
reconfigured in the connection. You should set the FaceName before setting the CPI, LPI, or FontSize. Otherwise, every time
you set FaceName, query CPI, LPI, and FontSize and make sure that they have the desired values.
Restrictions
The connection associated with each method must be in a particular state for the method to succeed. If the restrictions are
not met, an appropriate exception is raised.
The following restrictions must be satisfied while any property or method of the autECLPageSettings object is invoked.
The host session should not be printing when this API is invoked.
The File -> Page Setup and File -> Printer Setup dialogs must not be in use.
The associated connection must not be in PDT mode.
Connection types
The following connection types are valid for the methods in the autECLPageSettings class:
3270 display
3270 printer
5250 display
VT (ASCII)
If a property or method is accessed or called on an unsupported connection, an exception is raised. Use the ConnType
property to determine the connection type.
Properties
CPI
This property determines the number of characters printed per inch. This is a Long data type and is read/write enabled.
Set this property to the predefined constant pcFontCPI to select the Font CPI in Page Settings or set it to some specific CPI
value. If this property is queried when FontCPI is configured in the connection, the actual CPI value is returned and the
constant pcFontCPI is not returned.
To determine whether FontCPI is set in the connection, use the property FontCPI.
Example
FontCPI
This determines whether Font CPI is set in the connection. FontCPI is a Boolean data type and is read-only.
Example
LPI
This property determines the number of lines printed per inch. This is a Long data type and is read/write enabled. Set it to the
predefined constant pcFontLPI to select the Font LPI in Page Settings or set it to some specific LPI value. If this property is
queried when FontLPI is configured in the connection, the actual LPI value is returned and the constant pcFontLPI is not
returned. To determine whether FontLPI is set in the connection, use the property FontLPI.
Example
FontLPI
This property determines whether Font LPI is set in the connection. FontLPI is a Boolean data type and is read-only.
Example
FaceName
This is the Font Face Name of the Page Settings of the connection. FaceName is a String data type and is read/write
enabled.
Example
FontSize
This is the size of the font in the Page Settings of the connection. FontSize is a Long data type and is read/write enabled.
Notes:
1. This property is for sessions that use a DBCS code page. Connections that use an SBCS host code page will raise an
exception.
2. Because FontSize is dependent on the FaceName of the connection, FaceName should be set before FontSize is
set.
Example
MaxLinesPerPage
This property is the maximum number of lines that can be printed per page. This is also called maximum print lines or MPL.
Valid values are in the range 1-255. This is a Long data type and is read/write enabled.
Example
MaxCharsPerLine
This property is the maximum number of characters that can be printed per line. This is also called maximum print position or
MPP. Valid values are in the range 1-255. This is a Long data type and is read/write enabled.
Example
Name
This property is the connection name string of the connection for which autECLPageSettings was set. Personal
Communications returns only the short character ID (a single alphabetical character from A to Z) in the string. There can be
only one Personal Communications connection open with a given name. For example, there can be only one connection A
open at a time. Name is a String data type and is read-only.
Example
Handle
This property is the handle of the connection for which the autECLPageSettings object was set. There can be only one
Personal Communications connection open with a given handle. For example, there can be only one connection A open at a
time. Handle is a Long data type and is read-only.
Example
ConnType
This property is the connection type for which autECLPageSettings was set. This type might change over time. ConnType is a
String data type and is read-only.
Example
CodePage
This property is the connection type for which autECLPageSettings was set. This type might change over time. ConnType is a
String data type and is read-only.
Example
Started
This property indicates whether the emulator window is started. The value is TRUE if the window is open; otherwise, it is
FALSE. Started is a Boolean data type and is read-only.
Example
CommStarted
This property indicates the status of the connection to the host. The value is TRUE if the host is connected; otherwise, it is
FALSE. CommStarted is a Boolean data type and is read-only.
Example
APIEnabled
This property indicates whether the emulator is API-enabled. A connection can be API-enabled or disabled depending on the
state of its API settings (in a Personal Communications window, click Edit -> Preferences -> API). The value is TRUE if the
emulator is API-enabled; otherwise, it is FALSE. APIEnabled is a Boolean data type and is read-only.
Example
Ready
This property indicates whether the emulator window is started, API-enabled, and connected. This property checks for all
three properties. The value is TRUE if the emulator is ready; otherwise, it is FALSE. Ready is a Boolean data type and is
read-only.
Example
autECLPageSettings Methods
The following section describes the methods that are valid for the autECLPageSettings object.
void RestoreTextDefaults()
void SetConnectionByName (String Name)
void SetConnectionByHandle (Long Handle)
RestoreTextDefaults
The RestoreTextDefaults method restores the system default values of the Text property page in the Page Setup dialog of
the connection. This is equivalent to pressing the Default button on the Text property page of the Page Setup Dialog of the
connection.
Prototype
void RestoreTextDefaults()
Parameters
None
Return Value
None
Example
SetConnectionByName
The SetConnectionByName method uses the connection name to set the connection for a newly created
autECLPageSettings object. This connection name is the short connection ID (a single alphabetical character from A to Z).
There can be only one Personal Communications connection open with a given name. For example, there can be only one
connection A open at a time.
Note:
Do not call this method if you are using the autECLPageSettings object contained in the autECLSession object.
Prototype
Parameters
String Name
One-character string short name of the connection. Valid values are A-Z.
Return Value
None
Example
The following example shows how to use the connection name to set the connection for a newly created autECLPageSettings
object.
SetConnectionByHandle
The SetConnectionByHandle method uses the connection handle to set the connection for a newly created
autECLPageSettings object. In Personal Communications, this connection handle is a Long integer. There can be only one
Personal Communications connection open with a given handle. For example, there can be only one connection A open at a
time.
Note:
Do not call this method if you are using the autECLPageSettings object contained in the autECLSession object.
Prototype
Parameters
Long Handle
Long integer value of the connection to be set for the object.
Return Value
None
Example
The following example shows how to use the connection handle to set the connection for a newly created
autECLPageSettings object.
autECLPrinterSettings Class
The autECLPrinterSettings object controls the Printer Settings of a Personal Communications connection. Its name in the
registry is PCOMM.autECLPrinterSettings. This automation object can also be used in VB scripts.
The read-only property autECLPrinterSettings has been added to the autECLSession object. See autECLSession Class
for information about how to use this property.
Note:
The autECLPrinterSettings object in the autECLSession object is set by the autECLSession object.
The following example shows how to create and set the autECLPrinterSettings object in Visual Basic.
Usage Notes
You must initially set the connection for the object you create. Use SetConnectionByName or SetConnectionByHandle to
initialize your object. The connection can be set only once. After the connection is set, any further calls to the set connection
methods cause an exception. If you do not set the connection and try to access a property or method, an exception is raised.
The properties CPI, LPI, and FontSize are dependent on the property FaceName. Therefore, if CPI, LPI, or FontSize are set
before the FaceName is set, and if they are not valid for the new FaceName, different CPI, LPI, or FontSize values might be
reconfigured in the connection. You should set the FaceName before setting the CPI, LPI, or FontSize. Otherwise, every time
you set FaceName, query CPI, LPI, and FontSize and make sure that they have the desired values.
Restrictions
The connection associated with each method must be in a particular state for the method to succeed. If the restrictions are
not met, an appropriate exception is raised.
The following restrictions must be satisfied while any property or method of the autECLPageSettings object is invoked.
The host session should not be printing when this API is invoked.
The File -> Page Setup and File -> Printer Setup dialogs should not be in use.
Properties
PDTMode
This property determines whether the connection is in PDT mode or not. PDTMode is a Boolean data type and is read/write
enabled.
Example
PDTFile
This property is the PDT file configured in the connection. This property gives a null string if the PDT file is not configured in
the connection. Otherwise, this property gives the fully qualified path name of the PDT file. PDTFile is a String data type and
is read-only.
Example
PrintMode
This property indicates the print mode of the connection. PrintMode is a Long data type and is read-only. This property returns
one of the following four enumerated values:
2 pcPrtToDskSeparate Print to Disk-Separate mode. This means the Print to Disk -> Separate option is selected in the
Printer listbox in the Printer Setup dialog of the connection.
3 pcSpecificPrinter Specific Printer mode. This means one of the printers is selected in the Printer listbox in the Printer
Setup dialog of the connection and the Use Windows Default Printer checkbox is clear.
4 pcWinDefaultPrinter Windows Default Printer mode. This means that the Use Windows Default Printer checkbox is
selected.
Example
Printer
This property is the name of the printer. It contains one of the following:
The name of the specific printer if the PrintMode of the connection is pcSpecificPrinter.
The name of the Windows default printer if the PrintMode of the connection is pcWinDefaultPrinter.
A null string if a printer is not configured in the connection or if the PrintMode of the connection is pcPrtToDskAppend
or pcPrtToDskSeparate.
For example:
Example
PrtToDskAppendFile
This property is the name of the file set for the Print to Disk-Append mode. This file is called the Print to Disk-Append file.
This property contains one of the following:
The fully qualified path name of the Print to Disk-Append file of the connection.
A null string if the Print to Disk-Append file is not configured in the connection.
Example
PrtToDskSeparateFile
This property is the name of the file set for the Print to Disk-Separate mode. This file is called the Print to Disk-Separate
file. This property contains one of the following:
The fully qualified path name of the Print to Disk-Separate file of the connection.
A null string if the Print to Disk-Separate file is not configured in the connection.
Example
PromptDialogOption
This property indicates whether the option to show the Printer Setup dialog before printing is set or not. PromptDialogOption
is a Boolean data type and is read-only.
Example
Name
This property is the connection name string of the connection for which autECLPrinterSettings was set. Personal
Communications returns only the short character ID (a single alphabetical character from A to Z) in the string. There can be
only one Personal Communications connection open with a given name. For example, there can be only one connection A
open at a time. Name is a String data type and is read-only.
Example
Handle
This property is the handle of the connection for which the autECLPrinterSettings object was set. There can be only one
Personal Communications connection open with a given handle. For example, there can be only one connection A open at a
time. Handle is a Long data type and is read-only.
Example
ConnType
This property is the connection type for which autECLPrinterSettings was set. This type might change over time. ConnType is
a String data type and is read-only.
Example
CodePage
This property is the code page of the connection for which autECLPrinterSettings was set. This code page might change over
time. CodePage is a Long data type and is read-only.
Example
Started
This property indicates whether the emulator window is started. The value is TRUE if the window is open; otherwise, it is
FALSE. Started is a Boolean data type and is read-only.
Example
CommStarted
This property indicates the status of the connection to the host. The value is TRUE if the host is connected; otherwise, it is
FALSE. CommStarted is a Boolean data type and is read-only.
Example
End If
APIEnabled
This property indicates whether the emulator is API-enabled. A connection is API-enabled or disabled depending on the state
of its API settings (in a Personal Communications window, click Edit -> Preferences -> API).
The value is TRUE if the emulator is API-enabled; otherwise, it is FALSE. APIEnabled is a Boolean data type and is
read-only.
Example
Ready
This property indicates whether the emulator window is started, API-enabled, and connected. This property checks for all
three properties. The value is TRUE if the emulator is ready; otherwise, it is FALSE. Ready is a Boolean data type and is
read-only.
Example
autECLPrinterSettings Methods
The following sections describe the methods that are valid for the autECLPrinterSettings object.
SetPDTMode
The SetPDTMode method sets the connection in PDT mode with the given PDT file or sets the connection in non-PDT mode
(also called GDI mode).
Restriction
If this method is called with bPDTMode set to FALSE, PrintMode of the associated connection must already be set to
SpecificPrinter or WinDefaultPrinter.
Prototype
Parameters
Boolean bPDTMode
Possible values are as follows:
TRUE to set the connection to PDT mode.
FALSE to set the connection to non-PDT mode (GDI mode).
String PDTFile
This optional parameter contains the PDT file name.
This parameter is used only if bPDTMode is TRUE. If this parameter is not specified and bPDTMode is set to TRUE, the
PDT file configured in the connection is used. If there is no PDT file already configured in the connection, this method fails
with an exception.
PDTFile in the PDFPDT subfolder in the Personal Communications installation path is used.
Return Value
None
Example
SetPrtToDskAppend
This method sets the PrintMode of the connection to Print to Disk-Append mode. It also sets the appropriate file for this
mode.
Notes:
1. The folder where this file is to be set must have write access. Otherwise, this method fails with an exception.
Prototype
Parameters
String FileName
This optional parameter contains the name of the Print to Disk-Append file.
The user-class application data directory path will be used to locate the file.
The directory must exist in the path, or the method will fail with an exception. It is not necessary that the file exist in
the path.
If this parameter is not specified, the file configured for this PrintMode in the connection is used. If there is no file already
configured in the connection, this method fails with an exception.
Return Value
None
Example
SetPrtToDskSeparate
This method sets the PrintMode of the connection to Print to Disk-Separate mode. It also sets the appropriate file for this
mode.
Notes:
1. The folder where this file is to be set must have write access. Otherwise, this method fails with an exception.
Prototype
Parameters
String FileName
This optional parameter contains the name of the Print to Disk-Separate file.
If this parameter is not specified, the file configured for this PrintMode in the connection is used.
NULL (default)
The file that is currently configured for this PrintMode in the connection is used. If there is no file already configured
in the connection, the method fails with an exception.
The user-class application data directory path will be used to locate the file.
The directory must exist in the path, or the method will fail with an exception. It is not necessary that the file exist in
the path.
Note:
The file name must not contain an extension. If it contains an extension, the method fails with an exception.
Return Value
None
Example
SetSpecificPrinter
This method sets the PrintMode of the connection to Specific Printer mode with the printer specified by the Printer parameter.
Prototype
Parameters
String Printer
Contains the name of the printer. If the printer does not exist, this method fails with an exception.
For example:
Return Value
None
Example
SetWinDefaultPrinter
This method sets the PrintMode of the connection to Windows Default Printer mode (the connection will use the Windows
default printer). If no Windows default printer is configured, this method fails with an exception.
Prototype
void SetWinDefaultPrinter()
Parameters
None
Return Value
None
Example
SetConnectionByName
The SetConnectionByName method uses the connection name to set the connection for a newly created
autECLPrinterSettings object. In Personal Communications, this connection name is the short connection ID (a single
alphabetical character from A to Z). There can be only one Personal Communications connection open with a given name. For
example, there can be only one connection A open at a time.
Note:
Do not call this if you are using the autECLPrinterSettings object contained in the autECLSession object.
Prototype
Parameters
String Name
One-character string short name of the connection. Valid values are A-Z.
Return Value
None
Example
The following example shows how to use the connection name to set the connection for a newly created
autECLPrinterSettings object.
SetConnectionByHandle
The SetConnectionByHandle method uses the connection handle to set the connection for a newly created
autECLPrinterSettings object. In Personal Communications, this connection handle is a Long integer.
There can be only one Personal Communications connection open with a given handle. For example, there can be only one
connection A open at a time.
Note:
Do not call this method if you are using the autECLPrinterSettings object contained in the autECLSession object.
Prototype
Parameters
Long Handle
The Long integer value of the connection to set for the object.
Return Value
None
Example
The following example shows how to use the connection handle to set the connection for a newly created
autECLPrinterSettings object.
If PrSet.PDTMode Then
'your logic here...
End If
If it is a simple application or the only application that uses the assembly, Microsoft recommends that the assembly be
copied in the same directory as the application.
If multiple applications are referencing the assembly, you can install them in the Global Assembly Cache (GAC) and
have all the solutions reference the assembly in the GAC.
The model for programming the types exposed by Interop Assemblies is very similar to COM. The methods, properties, and
events exposed by the COM object can be accessed by any .NET language, using the syntax of the language. A sample
application (ECLSamps.net) written in C# is provided in the \samples directory in the Personal Communications installation
image. The sample demonstrates the simple usage of various Interop Assembly types.
For Visual Basic 6.0, projects that use Personal Communications automation objects and have been migrated to Visual Basic
.NET using the conversion assistant wizard, you only need to replace the references that the conversion assistant wizard
implicitly generates with the corresponding Personal Communications Interop references (from the \Interops directory) and
recompile. The way to replace the references is to delete all the references generated by the conversion assistant and use
Visual Studio .NET to add the .NET interop references. If you have registered the assemblies in the GAC and want to use
them, add the references and set the Copy Local property for the Personal Communications Interop references to False.
The PIAs for the Personal Communications emulator automation objects are installed in the \Interops directory in the
Personal Communications installation image. If the Personal Communications product installer detects that the .NET
framework is present, it gives you the additional option to register the types in the GAC. While installing the assemblies in the
GAC, the PIAs will also be placed in the registry, under the registry key of the corresponding type library.
Table 2 lists the PIAs supplied for the Personal Communications automation objects