Symantec, the Symantec Logoare trademarks or registered trademarks of Symantec
Corporation orits affiliatesin theU.S. andother countries.Other namesmay betrademarks
of their respective owners.
This Symantec product may contain third party software for which Symantec is required
to provide attribution to the third party (“Third Party Programs”). Some of the Third Party
Programs areavailable under open source or free softwarelicenses. TheLicense Agreement
accompanying the Software does not alter any rights or obligations you may have under
those opensource or free software licenses.Please see the Third PartyLegal Notice Appendix
to this Documentation or TPIP ReadMe File accompanying this Symantec product for more
information on the Third Party Programs.
The product described in this document is distributed under licenses restricting its use,
copying, distribution, and decompilation/reverse engineering. No part of this document
may be reproduced in any form by any means without prior written authorization of
Symantec Corporation and its licensors, if any.
THE DOCUMENTATIONIS PROVIDED"AS IS" ANDALL EXPRESSOR IMPLIED CONDITIONS,
REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT,
ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO
BE LEGALLYINVALID. SYMANTEC CORPORATIONSHALL NOTBE LIABLE FORINCIDENTAL
OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING,
PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINED
IN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE.
The LicensedSoftware and Documentation are deemed to becommercial computersoftware
as definedin FAR 12.212 and subjectto restricted rights as definedin FAR Section 52.227-19
"Commercial Computer Software - Restricted Rights" and DFARS 227.7202, "Rights in
Commercial Computer Software or Commercial Computer Software Documentation", as
applicable, and any successor regulations. Any use, modification, reproduction release,
performance, displayor disclosure of the LicensedSoftware and Documentation by theU.S.
Government shall be solely in accordance with the terms of this Agreement.
Page 3
Symantec Corporation
20330 Stevens Creek Blvd.
Cupertino, CA 95014
http://www.symantec.com
Printed in the United States of America.
10 9 8 7 6 5 4 3 2 1
Page 4
Technical Support
Symantec Technical Support maintains support centers globally. Technical
Support’s primary role is to respond to specific queries about product features
and functionality.The Technical Support group also creates content forour online
Knowledge Base. The Technical Support group works collaboratively with the
other functional areas within Symantec to answer your questions in a timely
fashion. Forexample, the Technical Support groupworks withProduct Engineering
and SymantecSecurity Response to provide alerting services and virusdefinition
updates.
Symantec’s maintenance offerings include the following:
■ A range of support options that give you the flexibility to select the right
amount of service for any size organization
■ Telephone and Web-based support that provides rapid response and
up-to-the-minute information
■ Upgrade assurance that delivers automatic software upgrade protection
■ Global support that is available 24 hours a day, 7 days a week
■ Advanced features, including Account Management Services
For information about Symantec’s Maintenance Programs, you can visit our Web
site at the following URL:
www.symantec.com/techsupp/
Contacting Technical Support
Customers with a current maintenance agreement may access Technical Support
information at the following URL:
www.symantec.com/techsupp/
Before contacting Technical Support, make sure you have satisfied the system
requirements that are listed in your product documentation. Also, you should be
at thecomputer onwhich theproblem occurred,in caseit is necessary to replicate
the problem.
When you contact Technical Support, please have the following information
available:
■ Product release level
■ Hardware information
■ Available memory, disk space, and NIC information
■ Operating system
Page 5
■ Version and patch level
■ Network topology
■ Router, gateway, and IP address information
■ Problem description:
■ Error messages and log files
■ Troubleshooting that was performed before contacting Symantec
■ Recent software configuration changes and network changes
Licensing and registration
If yourSymantec product requires registration ora license key,access our technical
support Web page at the following URL:
www.symantec.com/techsupp/
Customer service
Customer service information is available at the following URL:
www.symantec.com/techsupp/
Customer Service is available to assist with the following types of issues:
■ Questions regarding product licensing or serialization
■ Product registration updates, such as address or name changes
■ General product information (features, language availability, local dealers)
■ Latest information about product updates and upgrades
■ Information about upgrade assurance and maintenance contracts
■ Information about the Symantec Buying Programs
■ Advice about Symantec's technical support options
■ Nontechnical presales questions
■ Issues that are related to CD-ROMs or manuals
Page 6
Maintenance agreement resources
If you want to contact Symantec regarding an existing maintenance agreement,
please contact the maintenance agreement administration team for your region
as follows:
Additional enterprise services
Symantec offers a comprehensive set of services that allow you to maximize your
investment in Symantec products and to develop your knowledge, expertise, and
global insight, which enable you to manage your business risks proactively.
Enterprise services that are available include the following:
contractsadmin@symantec.comAsia-Pacific and Japan
semea@symantec.comEurope, Middle-East, and Africa
supportsolutions@symantec.comNorth America and Latin America
Symantec EarlyWarning Solutions
Managed Security Services
Consulting Services
Educational Services
To access more information about Enterprise services, please visit our Web site
at the following URL:
www.symantec.com
Select your country or language from the site index.
These solutions provide early warning of cyber attacks, comprehensive threat
analysis, and countermeasures to prevent attacks before they occur.
These servicesremove the burden of managingand monitoringsecurity devices
and events, ensuring rapid response to real threats.
Symantec Consulting Services provide on-site technical expertise from
Symantec andits trusted partners. Symantec ConsultingServices offera variety
of prepackaged and customizable options that include assessment, design,
implementation, monitoring,and managementcapabilities. Each is focused on
establishing andmaintaining the integrity and availabilityof your IT resources.
Educational Services provide a full array of technical training, security
education, security certification, and awareness communication programs.
■ What you can do with the pcAnywhere Automation Server
■ Before you start
1
■ Where to find more information
About OLE Automation
OLE Automation is a technology that lets you create an external application or
other development tool (such as a script or macro) that can control and automate
any exposed function within an application.
OLE Automation consists of the following components:
OLE Automation server
An application or software component that exposes its
functionality so that it can be accessed or controlled by
other applications or development tools
The pcAnywhere Automation Server is an example of an
OLE Automation server.
Page 10
Using OLE Automation with Symantec pcAnywhere
10
About the pcAnywhere Automation Server
OLE Automation controller
An external application accesses an OLE Automation server by connecting to the
server and then requesting access to one or more of its published interfaces. An
interface is an entry point that allows access to one or more related methods or
properties. After an application obtains an interface to the server, it can then call
any internal interface method as though it were part of the external application.
An application or development tool that accesses and
controls the components that have been exposed by the
OLE Automation server
You canuse any programming language that supports OLE
Automation. The two most common programming
languages are Microsoft Visual Basic and Microsoft Visual
C++.
About the pcAnywhere Automation Server
The pcAnywhere Automation Server lets external applications manage
pcAnywhere remote and host files to automate remote control and file transfer
tasks. The pcAnywhere Automation Server functions as a programmable
replacement for the Symantec pcAnywhere user interface and mirrors much of
its default behavior.
For example, when you create a host object in pcAnywhere, the first available
modem TAPIdevice is assigned by default. Similarly, when youcreate a host object
using the pcAnywhere Automation Server and then enumerate through the list
of assignedconnections, the first available modem TAPI device isalready assigned.
What you can do with the pcAnywhere Automation
Server
The pcAnywhereAutomation Server lets you automatea variety of administrative
and productivity tasks.
You can use the pcAnywhere Automation Server to do the following:
■ Automatically distribute and install software updates on multiple computers
across your network
■ Schedule automatic file transfers between computers for audit or archive
purposes
■ Automatically add a name to or remove a name from the allowed callers list
on every pcAnywhere host on your network
Page 11
This documentcontains severalexamples, writtenin both Visual Basic and Visual
C++, to illustrate how to connect to and use the pcAnywhere Automation Server.
See “About Visual Basic objects” on page 17.
See “About Visual C++ objects” on page 59.
Before you start
During a connection to the pcAnywhere Automation Server and its interfaces,
identifier parameters, known as globally unique identifiers (GUIDs), are passed
to the automation library API functions. A separate GUID is assigned to the
pcAnywhere AutomationServer and to each exposedinterface. These GUIDs must
be present in the system registry to connect an external application to the
pcAnywhere Automation Server and its interfaces.
You can register the GUID entries automatically if you are running the external
application ona computer on which SymantecpcAnywhere is installed. Otherwise,
you must register the GUID entries manually.
See “Automatically registering the remote engine” on page 11.
See “Manually registering the remote engine” on page 11.
Before you start
11Using OLE Automation with Symantec pcAnywhere
Automatically registering the remote engine
Before you connect to another computer for the first time using your OLE client,
you mustself-register theremote engine. You can dothis automatically when you
start a remote object in Symantec pcAnywhere.
To automatically register the remote engine
To open Symantec pcAnywhere, do one of the following:
1
■ On the desktop, double-click the Symantec pcAnywhere program icon.
■ On theWindows taskbar, click Start> Programs >Symantec pcAnywhere.
In the pcAnywhere Manager window, click Remotes.
2
Double-click a remote connection item.
3
This process registers the remote engine. You do not need to complete the
connection.
Manually registering the remote engine
If pcAnywhere is not installed on the computer on which you are running the
external application, you must register the GUIDs manually by running the
Page 12
Using OLE Automation with Symantec pcAnywhere
12
Before you start
pcAnywhere Automation Server executable file (Winawsvr.exe). You only need
to runthe executable file once to add the GUIDsto the registry. The Winawsvr.exe
file is located in the installation directory.
Accessing the pcAnywhere Automation Server
You can access the pcAnywhere Automation Server using any language platform
that supports OLE Automation. The two most popular language platforms that
support OLE Automation are Visual Basic and Visual C++.
The coding principles for these two platforms are similar, although in the Visual
Basic environment, much of the low-level work is performed behind the scenes
by the Visual Basic run-time system.
Accessing the pcAnywhere Automation Server with Visual Basic
The VisualBasic programminglanguage has built-in support to interact withOLE
Automation servers, such as the pcAnywhere Automation Server. You create a
Standard Exe project, and then enter code in each method to access the
pcAnywhere Automation Server. Visual Basic takes the high-level method calls
in the source files and expands them internally into the corresponding low-level
OLE Automation method calls.
To access the pcAnywhere Automation Server with Visual Basic
Add a pair of Object variables for each pcAnywhere object that you want to
1
access.
For example,when working with remote objects, DIM aRemoteDataManager
and a RemoteDataObject as Object.
Use the RemoteDataManager to attach to the remote object’s data manager.
2
For example, call the CreateObject method with
WINAWSVR.REMOTEDATAMANAGER as a parameter.
Visual Basic uses the textual parameter to locate the manager’s identifier in
the registry and returns the interface to that manager.
Once there is a valid data manager object, use it to do any of the following:
3
■ Determine the current directory.
■ Change to another directory.
■ Enumerate the associated data object files in the current directory.
Page 13
Before you start
■ Create, retrieve, or delete a data object file.
After a data object is created or retrieved, you can get or set properties of the
4
object.
The Visual Basic syntax does not use a property’s name to differentiate
between getting and setting its value. Instead, the property’s position in
relation to the assignment operator determines whether the underlying
method call is a Get or a Set.
The following examples demonstrate a Get and a Set:
■ To get an object’s phone number value, place the property name to the
right of the assignment operator.
For example,s = RemoteData.PhoneNumber(), where s is a stringvariable.
■ To set the phone number, place the property name to the left of the
assignment operator.
For example, RemoteData.PhoneNumber = "555-1212"
Accessing the pcAnywhere Automation Server with Visual C++
The pcAnywhere Automation Server uses type libraries to expose information
about its interfaces and methods to automation clients that are written in Visual
C++. These type libraries use Microsoft Foundation Classes (MFC), which can be
imported into your application using the Visual C++ ClassWizard.
The data manager classes that are provided in the type libraries provide the
functionality thatis neededto obtainan interfaceto the pcAnywhere Automation
Server and perform high-level operations on the interface’s associated object
type.
Use the data manager object to do the following:
■ Determine or change the current directory.
13Using OLE Automation with Symantec pcAnywhere
■ Enumerate through the list of data object files in the current directory.
■ Create, retrieve, or delete a named object.
Once createdor retrieved, an object uses the associated dataobject class to examine
or modify any of its exposed properties. Most of these properties are exposed
through a pair of methods that begin with the word Get or Set. For example, a
user calls the GetPhoneNumber method to examine the object’s current phone
number property and calls SetPhoneNumber to set it.
Importing and viewing classes
The pcAnywhere Automation Server uses the following type libraries:
Page 14
Using OLE Automation with Symantec pcAnywhere
14
Before you start
Winawsvr.tlb
The following procedures explain how to import the class definitions from the
pcAnywhere AutomationServer type libraries into yourMFC application and then
view the classes that have been added to your application.
To import classes
In Visual C++, create an MFC application.
1
On the View menu, click Class Wizard.
2
In the Class Wizard dialog box, click Add Class, and then click From a type
3
library.
Double-click winawsvr.tlb.
4
In the Confirm Classes dialog box, click OK to import all class definitions.
5
In the Class Wizard dialog box, click Add Class, and then click From a type
6
library.
Double-click awrem32.tlb.
7
In the Confirm Classes dialog box, click OK to import all class definitions.
8
In the Class Wizard dialog box, click OK to complete the import process.
9
The classes are added to the application. These classes let you manipulate
objects and manage connections.
Importing the class definitions fromthe type libraries also adds support files
to theapplication. These files contain theclass definitions andimplementation
source code for the pcAnywhere Automation Server.
See “Viewing the class definitions and implementation files” on page 14.
To view the added classes
Provides the information needed to connect to the pcAnywhere
Automation Server and access its interfaces
Provides the information needed to controlpcAnywhere connectionsAwrem32.tlb
In Visual C++, open your MFC application.
1
In the Workspace window, click the ClassView tab.
2
Viewing the class definitions and implementation files
When you import the pcAnywhere Automation Server type libraries into your
application, the following files are added:
■ Winawsvr.h
■ Winawsvr.cpp
Page 15
■ Awrem32.h
■ Awrem32.cpp
These files contain the class definitions and implementation source code for the
pcAnywhere Automation Server. You do not need to edit these files; however,
each application source file that contains calls to the pcAnywhere Automation
Server methods must include Winawsvr.h.
To view the class definitions and implementation files
In Visual C++, open your MFC application.
1
In the Workspace window, click the FileView tab.
2
Launching host and remote OLE objects
Symantec pcAnywhere requires that you store all host and remote objects in the
default data directory. Before you launch a host orremote object that you created
using OLE, ensure that the object is located in the pcAnywhere default data
directory. The default directory is the All Users folder in Windows XP, and is the
ProgramData folder in Vista.
Where to find more information
15Using OLE Automation with Symantec pcAnywhere
Where to find more information
For more information about OLE automation, see the following references:
Defines the parameters for accessing and
controlling pcAnywherehost functionality
See “CRemoteDataManager methods”
on page 18.
See “CRemoteData properties” on page 21.
See “CRemoteDataEx object” on page 31.
See “CHostDataManager methods”
on page 34.
See “CHostData properties” on page 36.
See “CHostDataEx object” on page 47.
Awrem32 has one object, which consists of eight interfaces to support remote
control and file transfer sessions.
See “Awrem32 functions” on page 55.
Some functionsare no longer supported. However, object definitions areprovided
for use with earlier versions of pcAnywhere.
For functionsthat require passwords, password values can be setbut not retrieved.
This is for security purposes.
CRemoteDataManager methods
The CRemoteDataManager methods provide the parameters and return values
for accessing and controlling CRemoteData objects.
Table 2-2
CRemoteDataManager
method
ChangeDirectory(NewDirectory)
CRemoteDataManager methods
value
Return Value = StringCurrentDirectory()
Parameter =
NewDirectory
DescriptionParameter or return
Returns the full path name of the
current directory in which
pcAnywhere remote objects are
stored
Changes the current directory in
which pcAnywhere remote objects
are stored
Page 19
CRemoteDataManager methods
19Visual Basic object definitions
Table 2-2
CRemoteDataManager methods (continued)
CRemoteDataManager
method
FindFirst(Pattern)
FindFirst(Name string)
FindNext(Name)
RetrieveObject(Name)
value
Parameter =Pattern as
string
Parameter = Name as
string
Parameter = Name as
string
Return value= BooleanFindNext(Name)
Parameter = Name as
string
DescriptionParameter or return
Finds the first pcAnywhere remote
object file (*.chf) in the current
directory; file name pattern filters
based on the specified file name
pattern (an asterisk [*] findsall files
in the current directory)
Return bufferfor the full path name
of the remote object file (*chf) that
matches the specified pattern
Return bufferfor the full path name
of the remote object file that
matches thepattern that is specified
in the original call to FindFirst()
TRUE if another remote object file
that matches the pattern that is
specified in the call to FindFirst() is
found. The full path name of the
matching file is stored in Name
The fullyqualified remote object file
name to be loaded
RetrieveObject(AccessMode)
RetrieveObject(Password)
RetrieveObjectEx(Name)
Parameter =
AccessMode as integer
as string
Parameter = Name as
string
Specifies how this object is to be
used. This relates to the password
protection
The options are as follows:
■ 0 = Not specified
■ 1 = View only
■ 2 = View and Modify
■ 3 = Execute
Object password. May be NULLParameter = Password
The fullyqualified remote object file
name to be loaded
Page 20
Visual Basic object definitions
20
CRemoteDataManager methods
Table 2-2
CRemoteDataManager methods (continued)
CRemoteDataManager
method
RetrieveObjectEx(AccessMode)
RetrieveObjectEx(Password)
CreateObject(Name)
value
Parameter =
AccessMode as integer
as string
Return value = ObjectRetrieveObjectEx
Parameter = Name as
string
DescriptionParameter or return
Specifies how this object is to be
used. This relates to the password
protection
The options are as follows:
■ 0 = Not specified
■ 1 = View only
■ 2 = View and Modify
■ 3 = Execute
Object password. May be NULLParameter = Password
CRemoteDataEx object from the
specified file
Creates a CRemoteData object and
returns an LPDISPATCH pointer to
it. The parameter is the fully
qualified remote object file name
for the new object
CRemoteDataReturn value = ObjectCreateObject
CreateObjectEx(Name)
DeleteObject(Name)
DeleteObject(Password)
Parameter = Name as
string
Parameter = Name as
string
as string
Creates a CRemoteDataEx object
and returns an LPDISPATCH
pointer to it. The parameter is the
fully qualified remote object file
name for the new object
CRemoteDataExReturn value = ObjectCreateObjectEx
The fullyqualified remote object file
name of the object to be deleted
Object passwordParameter = Password
TRUE if object is deletedReturn value= BooleanDeleteObject
Page 21
CRemoteData properties
The properties and parameters that are available for the CRemoteData object are
shown as follows.
In Table 2-3, replace the information in angle brackets with the actual values.
CRemoteData properties
21Visual Basic object definitions
Table 2-3
CRemoteData properties and parameters
DescriptionParameterProperty
String<CRemoteData>.ComputerName(String)
Integer<CRemoteData>.RedialCount(Integer)
Integer<CRemoteData>.RedialDelay(Integer)
String<CRemoteData>.AutoLoginName(String)
String<CRemoteData>.AutoLoginPassword(String)
Sets the computer name or IP address of the
host computer.
Sets the phone number of the host computer.String<CRemoteData>.PhoneNumber(String)
Sets the system dialing properties.Bool<CRemoteData>.UseDialingProperties(Bool)
Sets the number of redial attempts before
cancelling the call.
Sets the number of seconds to wait between
redial attempts.
Sets the name of the user for automatic login.
For more information about using domain
logins:
See “CRemoteDataEx object” on page 31.
Sets the password for automatic logins in the
remote object.
For security reasons, the pcAnywhere
Automation Serverdoes not provide the ability
to read the password value. A password value
is not returned.
String<CRemoteData>.Password(String)
Bool<CRemoteData>.ExecuteProtection(Bool)
Sets thepassword onthe remoteobject foruse
with the ExecuteProtection, ReadProtection,
and WriteProtection settings.
For security reasons, the pcAnywhere
Automation Serverdoes not provide the ability
to read the password value. A password value
is not returned.
Sets the requirement of apassword to execute
the object. Set by Password.
Page 22
Visual Basic object definitions
22
CRemoteData properties
Table 2-3
CRemoteData properties and parameters (continued)
DescriptionParameterProperty
Bool<CRemoteData>.ReadProtection(Bool)
Bool<CRemoteData>.WriteProtection(Bool)
String<CRemoteData>.RecordFile(String)
Bool<CRemoteData>.RecordSession(Bool)
String<CRemoteData>.ReadObject(String)
String<CRemoteData>.WriteObject(String)
Sets therequirement of a password toview the
properties of the remote object. Set by
Password.
Sets the requirement of a password to save
changes tothe remote object. Set byPassword.
Activates and deactivates session logging.Bool<CRemoteData>.LogSession(Bool)
Sets the fully qualified path and name to the
location of the file that records the active
session.
Activates and deactivates automatic session
recording.
Sets the password of the object. Use this
property to refresh the local data copy of the
remote object.
Sets the password of the object. Use this
property tocreate the remote object orto write
changes that you have made to the remote
object.
The properties and return values for CRemoteData are shown in the following
table.
In Table 2-4, replace the information in angle brackets with the actual values.
Table 2-4
CRemoteData properties and return values
DescriptionReturn valueProperty
StringString = <CRemoteData>.ComputerName
StringString = <CRemoteData>.PhoneNumber
BoolBool = <CRemoteData>.UseDialingProperties
IntegerInteger = <CRemoteData>.RedialCount
Returns the computer name or IP address of
the host computer
Returns the phone number of the host
computer
Returns thesystem dialingproperties thatare
set in the remote object
Returns the number of redial attempts that is
set in the remote object
Page 23
CRemoteData properties
23Visual Basic object definitions
Table 2-4
Connection type properties
CRemoteData properties and return values (continued)
DescriptionReturn valueProperty
IntegerInteger = <CRemoteData>.RedialDelay
StringString = <CRemoteData>.AutoLoginName
BoolBool = <CRemoteData>.ExecuteProtection
BoolBool = <CRemoteData>.ReadProtection
BoolBool = <CRemoteData>.WriteProtection
StringString = <CRemoteData>.RecordFile
BoolBool = <CRemoteData>.RecordSession
Returns thenumber of seconds between redial
attempts
Returns the login name that is used for
automatic logins
Returns the value of the ExecuteProtection
setting
Returns the value of the ReadProtection
setting
Returns the value of the WriteProtection
setting
Returns TRUE if session logging is enabledBoolBool = <CRemoteData>.LogSession
Returns the fully qualified path and name of
the session recording file
Returns the value of the session recording
setting
The following table defines the connection type properties and parameters.
In Table 2-5, replace the information in angle brackets with the actual values.
Page 24
Visual Basic object definitions
24
CRemoteData properties
Table 2-5
Connection type properties and parameters
DescriptionParameterProperty
String<CRemoteData>.ConnectionType(String)
Sets the connection type of the remote. The
value that is passed in must be a valid
connection type as defined by the
FirstConnectionType() and
NextConnectionType() functions.
The followingare examples of valid connection
types:
■ COM1
■ COM2
■ COM3
■ COM4
■ TCP/IP
■ SPX
■ NetBIOS
■ ISDN via CAPI 2.0
■ Modem name (as it appears on the
computer)
The following table defines the connection type properties and return values.
In Table 2-6, replace the information in angle brackets with the actual values.
Table 2-6
Connection type properties and return values
DescriptionReturn valueProperty
StringString = <CRemoteData>.ConnectionTypes
Returns the connection type of the remote
object.
Page 25
CRemoteData properties
25Visual Basic object definitions
Table 2-6
Connection type properties and return values (continued)
DescriptionReturn valueProperty
IntegerInteger = <CRemoteData>.ConnectionType
StringString = <CRemoteData>.NextConnectionType
Returns the number of available connection
types.
The followingare examples of valid connection
types:
■ COM1
■ COM2
■ COM3
■ COM4
■ TCP/IP
■ SPX
■ NetBIOS
■ ISDN via CAPI 2.0
■ Modem name (as it appears on the
computer)
Returns the first available connection type.StringString = <CRemoteData>.FirstConnectionType
Returns the next available connection type.
This is called sequentially for the number of
connection types that is set in
<CRemoteData>.ConnectionType toenumerate
all connection types.
<CRemoteData>.FindConnectionType(ConnectionType)
Dialing properties
The following table defines the properties and parameters for setting the dialing
properties for modem connections.
In Table 2-7, replace the information in angle brackets with the actual values.
Table 2-7
Properties and parameters for dialing properties
BoolBool =
Returns TRUE if the named connection type
is found in the list of available connection
types.
DescriptionParameterProperty
String<CRemoteData>.AreaCode(String)
Sets the area code dialing properties for
modem connections
Page 26
Visual Basic object definitions
26
CRemoteData properties
Table 2-7
Properties and parameters for dialing properties (continued)
DescriptionParameterProperty
String<CRemoteData>.CountryCode(String)
Sets the country code dialing properties for
modem connections
The following table defines the properties and return values for modem dialing
properties.
In Table 2-8, replace the information in angle brackets with the actual values.
Table 2-8
Properties and return values for dialing properties
DescriptionReturn valueProperty
Returns the area code dialing properties.StringString = <CRemoteData>.AreaCode
Returns the dialing properties country code.StringString = <CRemoteData>.CountryCode
Returns thenumber of available country codes.IntegerInteger = <CRemoteData>.CountryCodes
StringString = <CRemoteData>.FirstCountryCode
StringString = <CRemoteData>.NextCountryCode
Returns the first available country code that
is listed in the operating system.
Returns the next available country code. This
is calledsequentially for the number ofcountry
codes that is set in
<CRemoteData.CountryCodes> to enumerate
all country codes.
COM device properties
The followingtable describes the properties andparameters that let you customize
the port settings for modem and other COM-based connections.
In Table 2-9, replace the information in angle brackets with the actual values.
Page 27
CRemoteData properties
27Visual Basic object definitions
Table 2-9
COM device properties and parameters
DescriptionParameterProperty
String<CRemoteData>.ComParity(String)
String<CRemoteData>.ComFlowControl(String)
String<CRemoteData>.ComStartedBy(String)
Sets the communications parity
The following values are valid:
■ <None>
■ Odd
■ Even
■ Mark
■ Space
Sets theflow control of COM-based connection
types
The following values are valid:
■ <None>
■ XONXOFF
■ RTS/CTS
■ Both
Sets thestart setting of COM-based connection
types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
■ Receive 2 <CR>’s
■ Modem response
String<CRemoteData>.ComEndedBy(String)
Sets the endsetting of COM-based connection
types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
Page 28
Visual Basic object definitions
28
CRemoteData properties
Table 2-9
COM device properties and parameters (continued)
DescriptionParameterProperty
Long<CRemoteData>.ComSpeed(Long)
Contains the maximum COM speed setting
The following values are valid:
■ 110
■ 300
■ 600
■ 1200
■ 2400
■ 4800
■ 9600
■ 38400
■ 57600
■ 115200
The following table describes the COM device properties and return values.
In Table 2-10, replace the information in angle brackets with the actual values.
Table 2-10
COM device properties and return values
DescriptionReturn valueProperty
StringString = <CRemoteData>.ComParity
Returns one of the following values for
communications parity:
■ <None>
■ Odd
■ Even
■ Mark
■ Space
StringString = <CRemoteData>.ComFlowControl
Returns the Com Flow setting of the remote
object
The following values are valid:
■ <None>
■ XONXOFF
■ RTS/CTS
■ Both
Page 29
CRemoteData properties
29Visual Basic object definitions
Table 2-10
COM device properties and return values (continued)
DescriptionReturn valueProperty
StringString = <CRemoteData>.ComStartedBy
StringString = <CRemoteData>.ComEndedBy
LongLong = <CRemoteData>.ComSpeed
Returns the Com Start control of COM-based
connection types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
■ Receive 2 <CR>’s
■ Modem response
Returns the Com End control of COM-based
connection types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
Returns the current setting of the Com Speed
of the remote object
The following values are valid:
■ 110
■ 300
■ 600
■ 1200
■ 2400
■ 4800
■ 9600
■ 38400
■ 57600
■ 115200
NetBIOS device properties
The following table defines the property and parameter for a NetBIOS network
device.
Page 30
Visual Basic object definitions
30
CRemoteData properties
In Table 2-11, replace the information in angle brackets with the actual values.
Table 2-11
NetBIOS property and parameter
Integer<CRemoteData>.LanaNumber(Integer)
The following table defines the NetBIOS property and return value.
In Table 2-12, replace the information in angle brackets with the actual values.
Table 2-12
NetBIOS property and return value
IntegerInteger = <CRemoteData>.LanaNumber
ISDN via CAPI 2.0 device properties
The following table defines the properties and parameters for European ISDN
connections.
In Table 2-13, replace the information in angle brackets with the actual values.
Table 2-13
ISDN via CAPI 2.0 properties and parameters
DescriptionParameterProperty
Sets the LAN Adapter (LANA) number for
NetBIOS connections
DescriptionReturn valueProperty
Returns thecurrent setting of the LANAdapter
(LANA) number for NetBIOS connections
DescriptionParameterProperty
Bool<CRemoteData>.CapiChannelBonding(Bool)
String<CRemoteData>.CapiExtensions(String)
Activates or deactivates channel bonding for
ISDN CAPI devices
Sets any additional CAPI extensions that are
needed for communications
The following table defines the properties and return values for European ISDN
connections.
In Table 2-14, replace the information in angle brackets with the actual values.
Table 2-14
ISDN via CAPI 2.0 properties and return values
DescriptionReturn valueProperty
BoolBool= <CRemoteData>.CapiChannelBonding
Returns the current ISDN CAPI channel
bonding setting in the remote object
Page 31
CRemoteDataEx object
31Visual Basic object definitions
Table 2-14
ISDN via CAPI 2.0 properties and return values (continued)
CRemoteDataEx object
The CRemoteDataEx object contains the same functionality as the CRemoteData
object with some additional functionality.
The following table describes the properties and parameters.
In Table 2-15, replace the information in angle brackets with the actual values.
Table 2-15
CRemoteDataEx parameters
DescriptionReturn valueProperty
StringString = <CRemoteData>.CapiExtensions
Returns the current list of CAPI extensions
from the remote object
DescriptionParameterProperty
String<CRemoteData>.PrivateKey(String)
String<CRemoteData>.CertificateName(String)
Byte<CRemoteData>.EncryptionLevel(Byte)
Sets the name of the private key container to
use.
Sets the common name of the private key to
use.
Sets the encryption level.
The following values are valid:
■ -1: None
■ 0: pcAnywhere
■ 1: Symmetric
■ 2: Public key
Bool<CRemoteData>.DenyLowerEncrypt(Bool)
String<CRemoteData>.AutoDomain(String)
Defines whether the remote computer allows
a connection to a host computer that uses a
lower level of encryption.
Sets the domain name for automatic logins.
This optionis used with NT authenticationand
Windows authentication.
The following table describes the properties and return values for the
CRemoteDataEx object.
In Table 2-16, replace the information in angle brackets with the actual values.
Page 32
Visual Basic object definitions
32
CRemoteDataEx object
Table 2-16
CRemoteDataEx properties and return values
DescriptionReturn valueProperty
StringString = <CRemoteData>.PrivateKey
StringString = <CRemoteData>.CertificateName
ByteByte = <CRemoteData>.EncryptionLevel
BoolBool = <CRemoteData>.DenyLowerEncrypt
StringString = <CRemoteData>.AutoDomain
Returns the name of the currently active
private key container.
Returns the common name of the active
private key container.
Returns one of the following encryption
settings:
■ -1: None
■ 0: pcAnywhere
■ 1: Symmetric
■ 2: Public key
Returns thevalue of the deny lowerencryption
setting.
Returns the domain name setting for
automatic logins. This option is used with NT
authentication and Windows authentication.
Visual Basic sample code for remote functionality
The followingVisual Basic sample code retrieves a remote dataobject and modifies
its properties:
Private Sub Command1_Click()
Dim RemoteDataManager as Object
Dim RemoteData as Object
Dim s as string
'Create CRemoteDataManager object
Set RemoteDataManager = CreateObject(WINAWSVR.REMOTEDATAMANAGER)
Set RemoteData = RemoteDataManager.CreateObject("test")
RemoteData.ConnectionType = "TCP/IP"
RemoteData.ComputerName = "Host1"
s = RemoteData.ConnectionType
MsgBox (s)
s = RemoteData.ComputerName
MsgBox (s)
RemoteData.WriteObject (0)
End Sub
CHostDataManager methods
The CHostDataManager methods provide the parameters and return values for
accessing and controlling CHostData objects.
CHostDataManager
method
CurrentDirectory()
FindFirst(Pattern)
FindFirst(Name string)
return value
Return value =
String
Parameter =
Pattern as string
Parameter =
Name as string
DescriptionParameter or
The full path name of the current
pcAnywhere data directory in which
pcAnywhere host objects are stored
File name pattern to filter object files (an
asterisk [*] finds all files in the current
directory)
Return buffer for the full path name of the
host object file that matches the specified
pattern
Page 35
CHostDataManager methods
35Visual Basic object definitions
CHostDataManager
method
FindFirst
FindNext(Name)
FindNext
RetrieveObject(Name)
RetrieveObject(AccessMode)
RetrieveObject(Password)
return value
Return value =
Boolean
Parameter =
Name as string
Return value =
Boolean
Parameter =
Name as string
Parameter =
AccessMode as
integer
Password as
string
DescriptionParameter or
TRUE if a host object file matching the
specified patternis found. The full pathname
of the matching file is stored in Name
Return buffer for the full path name of the
host object file that matches the pattern
specified in the original call to FindFirst()
TRUE ifanother host object file matching the
pattern specified in the call to FindFirst() is
found. The full path name of the matching
file is stored in Name
The fully qualified host object file name to be
loaded
Specifies how this object is to be used. This
relates to the password protection. The
options are as follows:
■ 0 = Not specified
■ 1 = View only
■ 2 = View and Modify
■ 3 = Execute
Object password. May be NULLParameter =
RetrieveObject
RetrieveObjectEx(Name)
RetrieveObjectEx(AccessMode)
Object
Parameter =
Name as string
Parameter =
AccessMode as
integer
CHostData object from the specified fileReturn value =
The fully qualified host object file name to be
loaded
Specifies how this object is to be used. This
relates to the password protection
The options are as follows:
■ 0 = Not specified
■ 1 = View only
■ 2 = View and Modify
■ 3 = Execute
Page 36
Visual Basic object definitions
36
CHostData properties
CHostDataManager
method
RetrieveObjectEx(Password)
RetrieveObjectEx
CreateObject(Name)
CreateObject
CreateObjectEx(Name)
CreateObjectEx
DeleteObject(Name)
return value
Password as
string
Object
Parameter =
Name as string
Object
Parameter =
Name as string
Object
Parameter =
Name as string
DescriptionParameter or
Object password. May be NULLParameter =
CHostDataEx object from the specified fileReturn value =
Creates a CHostData object and returns an
LPDISPATCH pointer to it. The parameter is
the fully qualified host object file name for
the new object
CHostDataReturn value =
Creates a CHostDataExobject and returns an
LPDISPATCH pointer to it. The parameter is
the fully qualified host object file name for
the new object
CHostDataExReturn value =
The fully qualified host object file name of
the object to be deleted
DeleteObject(Password)
DeleteObject
Launch(Name)
Launch
CHostData properties
The following table describes the properties and parameters that are available
for the CHostData object.
Password as
string
Boolean
Parameter =
Name as string
Boolean
Object passwordParameter =
TRUE if object is deletedReturn value =
Launches a host object file, which opens the
pcAnywhere host terminal window. The
parameter is the fully qualified host object
file of the object to be launched
TRUE if object is successfully launchedReturn value =
Page 37
CHostData properties
In Table 2-17, replace the information in angle brackets with the actual values.
37Visual Basic object definitions
Table 2-17
CHostData properties and parameters
DescriptionParameterProperty
Sets the phone number of the host computer.String<CHostData>.PhoneNumber(String)
Sets the system dialing properties.Bool<CHostData>.UseDialingProperties(Bool)
Integer<CHostData>.RedialCount(Integer)
Integer<CHostData>.RedialDelay(Integer)
String<CHostData>.Password(String)
Bool<CHostData>.ExecuteProtection(Bool)
Bool<CHostData>.ReadProtection(Bool)
Bool<CHostData>.WriteProtection(Bool)
Sets the number of redial attempts before
cancelling the call.
Sets the number of seconds to wait between
redial attempts.
Sets the password on the host object for use
with the ExecuteProtection, ReadProtection,
and WriteProtection settings.
For security reasons, the pcAnywhere
Automation Serverdoes not provide the ability
to read the password value. A password value
is not returned.
Sets the requirement of apassword to execute
the object. Set by Password.
Sets therequirement of a password toview the
properties of the host object. Set by Password.
Sets the requirement of a password to save
changes to the host object. Set by Password.
Activates and deactivates session logging.Bool<CHostData>.LogSession(Bool)
String<CHostData>.RecordFile(String)
Bool<CHostData>.RecordSession(Bool)
String<CHostData>.ReadObject(String)
String<CHostData>.WriteObject(String)
Sets the fully qualified path and name to the
location of the file that records the active
session.
Activates and deactivates automatic session
recording.
Sets the password for the object. You can use
this property to refresh the local data copy of
the host object.
Sets the password for the object. Use this
property to create the host object or to write
changes thatyou have made to thehost object.
Page 38
Visual Basic object definitions
38
CHostData properties
The following table describes the CHostData properties and return values.
In Table 2-18, replace the information in angle brackets with the actual values.
Table 2-18
CHostData properties and return values
DescriptionReturn valueProperty
StringString = <CHostData>.PhoneNumber
BoolBool = <CHostData>.UseDialingProperties
IntegerInteger = <CHostData>.RedialCount
IntegerInteger = <CHostData>.RedialDelay
BoolBool = <CHostData>.ExecuteProtection
BoolBool = <CHostData>.ReadProtection
BoolBool = <CHostData>.WriteProtection
StringString = <CHostData>.RecordFile
Returns the phone number of the host
computer
Returns the use of the system dialing
properties that are set in the host object
Returns the number of redial attempts that is
set in the host object
Returns thenumber of seconds between redial
attempts
Returns the value of the ExecuteProtection
setting
Returns the value of the ReadProtection
setting
Returns the value of the Write Protection
setting
Returns TRUE if session logging is enabledBoolBool = <CHostData>.LogSession
Returns the fully qualified path and name of
the session recording file
Connection type properties
The following table describes the connection type properties and parameters.
In Table 2-19, replace the information in angle brackets with the actual values.
BoolBool = <CHostData>.RecordSession
Returns the value of the session recording
setting
Page 39
CHostData properties
39Visual Basic object definitions
Table 2-19
Connection type properties and parameters
DescriptionParameterProperty
String<CHostData>.ConnectionType(String)
String<CHostData>.AssignConnection(String)
String<CHostData>.UnassignConnection(String)
Sets theconnection type of the host.The value
that is passed in must be a valid connection
type as defined by the FirstConnectionType()
and NextConnectionType() functions.
The followingare examples of valid connection
types:
■ COM1
■ COM2
■ COM3
■ COM4
■ TCP/IP
■ SPX
■ NetBIOS
■ ISDN via CAPI 2.0
■ Modem name (as it appears on the
computer)
Sets the connection type that is defined inthe
string to active status.
Sets the connection type that is defined inthe
string to inactive status.
The following table describes the connection type properties and return values.
In Table 2-20, replace the information in angle brackets with the actual values.
Table 2-20
Connection type properties and return values
DescriptionReturn valueProperty
StringString = <CHostData>.ConnectionTypes
Returns the connection type of the host
object.
Page 40
Visual Basic object definitions
40
CHostData properties
Table 2-20
Connection type properties and return values (continued)
DescriptionReturn valueProperty
IntegerInteger = <CHostData>.ConnectionType
StringString = <CHostData>.NextConnectionType
Returns the number of available connection
types.
The following are examples of valid
connection types:
■ COM1
■ COM2
■ COM3
■ COM4
■ TCP/IP
■ SPX
■ NetBIOS
■ ISDN via CAPI 2.0
■ Modem name (as it appears on the
computer)
Returns the first available connection type.StringString = <CHostData>.FirstConnectionType
Returns the next available connection type.
This is called sequentially for the number of
connection types that is set in
<CHostData>.ConnectionTypes toenumerate
all connection types.
Returns the first assigned active connection
type.
StringString = <CHostData>.NextAssignedConnection
Returns the next assigned active connection
type.
BoolBool =
Returns TRUE if the connection type that is
passed in matches any of the active
connection types.
Page 41
AssignConnection(ConnectionType) method
The AssignConnection(ConnectionType) method places the requestedconnection
type onthe host object’slist of assigned connection types and makes itthe current
connection type when processing subsequent device-specific method calls.
If the requested connection type is already on the list of assigned connections,
the list of assigned connections does not change. Only the current connection
type is changed to the requested type. It is normal to call the AssignConnection
method on the same object multiple times in the course of getting and setting
connection-specific values.
AssignConnection returns TRUE if the connection type that ispassed in exists on
the computer and is either successfully assigned or already assigned. It returns
FALSE if either the requested connection type does not exist on the computer or
the current assigned connection count is already at the maximum allowed level.
A pcAnywhere host object can support up to two assigned connection types. The
AssignConnection method returns FALSE if it detects an attempt to exceed this
limit.
The following table defines the AssignConnection parameter:
CHostData properties
41Visual Basic object definitions
DescriptionParameter
The name of a connection device type to be assignedConnectionType as
string
The following table defines the AssignConnection return value:
DescriptionReturn value
Boolean
TRUE if this device type is available and the maximum allowed
assigned connection count has not already been reached
UnassignConnection(ConnectionType) method
The UnassignConnection(ConnectionType) methodreturns TRUE if the connection
type thatis passed in is successfullyremoved from the list ofassigned connection
types.
The following table defines the UnassignConnection parameter:
DescriptionParameter
The name of a connection device type to be unassignedConnectionType as
string
Page 42
Visual Basic object definitions
42
CHostData properties
Dialing properties
The following table defines the UnassignConnection return value:
DescriptionReturn value
TRUE if this device type is successfully unassignedBoolean
The followingtable defines theproperties and return values for setting the dialing
properties for modem connections.
In Table 2-21, replace the information in angle brackets with the actual values.
Table 2-21
Properties and parameters for modem dialing properties
DescriptionParameterProperty
Sets the areacode for the modem connectionsString<CHostData>.AreaCode(String)
Sets the country code for modem connectionsString<CHostData>.CountryCode(String)
The following table defines the properties and return values for modem dialing
properties.
In Table 2-22, replace the information in angle brackets with the actual values.
Table 2-22
Properties and return values for modem dialing properties
DescriptionReturn valueProperty
Returns the area code.StringString = <CHostData>.AreaCode
Returns the country code.StringString = <CHostData>.CountryCode
Returns thenumber of available country codes.IntegerInteger = <CHostData>.CountryCodes
StringString= <CHostData>.FirstCountryCode
StringString = <CHostData>.NextCountryCode
Returns the first available country code that
is listed in the operating system.
Returns the next available country code. This
is calledsequentially for the number ofcountry
codes thatis setin <CHostData>.CountryCodes
to enumerate all country codes.
COM device properties
The following table defines the properties and parameters that let you customize
the port settings for modem and other COM-based connections.
Page 43
CHostData properties
In Table 2-23, replace the information in angle brackets with the actual values.
43Visual Basic object definitions
Table 2-23
COM device properties and parameters
DescriptionParameterProperty
String<CHostData>.ComParity(String)
String<CHostData>.ComFlowControl(String)
String<CHostData>.ComStartedBy(String)
Sets the communications parity
The following values are valid:
■ <None>
■ Odd
■ Even
■ Mark
■ Space
Sets theflow control of COM-based connection
types
The following values are valid:
■ <None>
■ XONXOFF
■ RTS/CTS
■ Both
Sets thestart setting of COM-based connection
types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
■ Receive 2 <CR>’s
■ Modem response
String<CHostData>.ComEndedBy(String)
Sets the endsetting of COM-based connection
types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
Page 44
Visual Basic object definitions
44
CHostData properties
Table 2-23
COM device properties and parameters (continued)
DescriptionParameterProperty
Long<CHostData>.ComSpeed(Long)
Sets the maximum COM speed setting
The following values are valid:
■ 110
■ 300
■ 600
■ 1200
■ 2400
■ 4800
■ 9600
■ 38400
■ 57600
■ 115200
The following table describes the COM device properties and return values.
In Table 2-24, replace the information in angle brackets with the actual values.
Table 2-24
COM device properties and return values
DescriptionReturn valueProperty
StringString = <CHostData>.ComParity
Returns one of the following values as the
communications parity:
■ <None>
■ Odd
■ Even
■ Mark
■ Space
StringString = <CHostData>.ComFlowControl
Returns theCom Flow setting of thehost object
The following values are valid:
■ <None>
■ XONXOFF
■ RTS/CTS
■ Both
Page 45
CHostData properties
45Visual Basic object definitions
Table 2-24
COM device properties and return values (continued)
DescriptionReturn valueProperty
StringString = <CHostData>.ComStartedBy
StringString = <CHostData>.ComEndedBy
LongLong = <CHostData>.ComSpeed
Returns the Com Start control of COM-based
connection types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
■ Receive 2 <CR>’s
■ Modem response
Returns the Com End control of COM-based
connection types
The following values are valid:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
Returns the current setting of the Com Speed
of the host object
The following values are valid:
■ 110
■ 300
■ 600
■ 1200
■ 2400
■ 4800
■ 9600
■ 38400
■ 57600
■ 115200
NetBIOS device properties
The following table defines the property and parameter for NetBIOS network
devices.
Page 46
Visual Basic object definitions
46
CHostData properties
In Table 2-25, replace the information in angle brackets with the actual values.
Table 2-25
NetBIOS property and parameter
Integer<CHostData>.LanaNumber(Integer)
The following table defines the property and return value for NetBIOS network
devices.
In Table 2-26, replace the information in angle brackets with the actual values.
Table 2-26
NetBIOS return values
IntegerInteger = <CHostData>.LanaNumber
ISDN via CAPI 2.0 device properties
The following table defines the properties and parameters for European ISDN
connections.
In Table 2-27, replace the information in angle brackets with the actual values.
Table 2-27
ISDN via CAPI 2.0 properties and parameters
DescriptionParameterProperty
Sets the LAN Adapter (LANA) number for
NetBIOS connections
DescriptionReturn valueProperty
Returns thecurrent setting of the LANAdapter
(LANA) number for NetBIOS connections
DescriptionParameterProperty
Bool<CHostData>.CapiChannelBonding(Bool)
String<CHostData>.CapiExtensions(String)
Activates or deactivates channel bonding for
ISDN CAPI devices
Sets any additional CAPI extensions that are
needed for communications
Table 2-28 defines the properties and return values for European ISDN
connections.
Table 2-28
ISDN via CAPI 2.0 properties and return values
DescriptionReturn valueProperty
BoolBool= <CHostData>.CapiChannelBonding
Returns the current ISDN CAPI channel
bonding setting in the host object
Page 47
CHostDataEx object
47Visual Basic object definitions
Table 2-28
CHostDataEx object
The CHostDataEx object contains the same functionality as the CHostData object
with some additional functionality.
The following table describes the properties and parameters.
In Table 2-29, replace the information in angle brackets with the actual values.
Table 2-29
ISDN via CAPI 2.0 properties and return values (continued)
DescriptionReturn valueProperty
StringString = <CHostData>.CapiExtensions
Returns the current list of CAPI extensions
from the host object
CHostDataEx properties and parameters
DescriptionParameterProperty
String<CHostData>.CryptPrivateKey(String)
String<CHostData>.CryptCommonName(String)
Byte<CHostData>.CryptReqLevel(Byte)
Sets the name of the private key container to
use.
Sets the common name of the private key to
use.
Sets the encryption level.
The following values are valid:
■ -1: None
■ 0: pcAnywhere
■ 1: Symmetric
■ 2: Public key
Bool<CHostData>.CryptRefuseLower(Bool)
Bool<CHostData>.ConfirmConnect(Bool)
Byte<CHostData>.ConfirmTimeout(Byte)
Defines whether the host computer accepts
connections froma remote computer that uses
a lower level of encryption.
Sets the fully qualified path to the caller files.String<CHostData>.CallersPath(String)
Defines whetherthe host user will be prompted
to confirm connections.
Sets the number of secondsbefore the prompt
to confirm the connection time limit expires.
Page 48
Visual Basic object definitions
48
CHostDataEx object
Table 2-29
CHostDataEx properties and parameters (continued)
DescriptionParameterProperty
Bool<CHostData>.ConfirmDeny(Bool)
Byte<CHostData>.PwAttempts(Byte)
Byte<CHostData>.PwTimeout(Byte)
Byte<CHostData>.ActiveKbds(Byte)
Byte<CHostData>.InactiveTimeout(Byte)
Defines whether the connection should be
ended ifthe promptto confirmthe connection
time limit expires.
Forces the use of case-sensitive passwords.Bool<CHostData>.PwCaseSensitive(Bool)
Sets the number of consecutive failed logon
attempts that are allowed before ending the
connection.
Sets the number of minutes that a user has to
complete the logon before the connection is
dropped.
Defines which mouse and keyboard will be
active during the connection.
The following values are valid:
■ 0: Host and remote
■ 1: Host
■ 2: Remote
Sets the number of minutes in which the
keyboard andmouse can be inactive beforethe
connection is ended.
Bool<CHostData>.LockSystemWhileWait(Bool)
Sets the lock host computer upon startup
setting.
Sets the run minimized host startup option.Bool<CHostData>.MinimizeOnLaunch(Bool)
Enables the host to run as a service.Bool<CHostData>.RunAsService(Bool)
Byte<CHostData>.ConnLostWait(Byte)
Sets the number of minutes to wait before
allowing another caller to connect.
Bool<CHostData>.ConnLostHostOpts(Bool)
Defines whetherto waitfor another connection
or cancel the host if the session ends
abnormally.
The following values are valid:
■ FALSE: Wait
■ TRUE: Cancel host
Page 49
CHostDataEx object
49Visual Basic object definitions
Table 2-29
CHostDataEx properties and parameters (continued)
DescriptionParameterProperty
Bool<CHostData>.EnableConnLostSecurity(Bool)
Byte<CHostData>.AuthenticationType(Byte)
Activates or deactivates the end of session
security options for sessions that end
abnormally.
Sets the authentication type.
The following values are valid:
■ 0: pcAnywhere
■ 1: pcAnywhere
■ 2: Windows
■ 3: NT
■ 4: pcAnywhere
■ 5: pcAnywhere
■ 6: ADS Active Directory Services
■ 7: Microsoft LDAP
■ 8: FTP
■ 9: HTTP
■ 10: HTTPS
■ 11: RSA SecurID
pcAnywhere authentication is used by default
if no authentication value is set or if the set
value is not valid (for example, the
authentication type is not available).
Byte<CHostData>.ConnLostSecurity(Byte)
Sets the security options for handling an
abnormal end of session.
The following values are valid:
■ 1: Log off user
■ 2: Restart host computer
■ 3: Lock computer
Byte<CHostData>.CallbkDelay(Byte)
Sets the number of seconds to wait before the
host modem calls back the remote.
Bool<CHostData>.EndSessHostOpts(Bool)
Defines whether the host waits for another
connection or is cancelled after a normal end
of session.
The following values are valid:
■ FALSE: Wait for next connection
■ TRUE: Cancel host
Page 50
Visual Basic object definitions
50
CHostDataEx object
Table 2-29
CHostDataEx properties and parameters (continued)
DescriptionParameterProperty
Bool<CHostData>.EnableEndSessSecurity(Bool)
Byte<CHostData>.EndSessSecurity(Byte)
Bool<CHostData>.BlankHost(Bool)
Bool<CHostData>.AllowRemoteMouse(Bool)
Bool<CHostData>.RebootOnDisconnect(Bool)
Bool<CHostData>.AllowDriveSecurity(Bool)
Activates or deactivates the security options
for a normal end of session.
Sets the security options for a normal end of
session.
The following values are valid:
■ 1: Log off user
■ 2: Restart host computer
■ 3: Lock computer
Sets screen blanking on the host computer.
Some video cards do not support this option.
Disables the use of the mouse on the remote
computer during a session.
Forces the computer to restart after any end
of session if TRUE.
Logs off the user after the session ends.Bool<CHostData>.PasswordAfterDisc(Bool)
Enables drive security options. This setting is
valid only on NTFS file systems.
Bool<CHostData>.UseDirectoryServices(Bool)
Enables the use of directory services for
authentication.
Sets the directory services settings.String<CHostData>.DirectoryServiceEntry(String)
The followingtable describes the properties andreturn values for the CHostDataEx
object.
In Table 2-30, replace the information in angle brackets with the actual values.
Table 2-30
CHostDataEx properties and return values
DescriptionReturn valueProperty
StringString = <CHostDataEx>.CryptPrivateKey
StringString = <CHostDataEx>.CryptCommonName
Returns the currently active private key
container.
Returns the common name of the active
private key container.
Page 51
CHostDataEx object
51Visual Basic object definitions
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
ByteByte = <CHostDataEx>.CryptReqLevel
BoolBool = <CHostDataEx>.CryptRefuseLower
StringString = <CHostDataEx>.CallersPath
BoolBool = <CHostDataEx>.ConfirmConnect
ByteByte = <CHostDataEx>.ConfirmTimeout
BoolBool = <CHostDataEx>.ConfirmDeny
BoolBool = <CHostDataEx>.PwCaseSensitive
Returns one of the following encryption
settings:
■ -1: None
■ 0: pcAnywhere
■ 1: Symmetric
■ 2: Public key
Returns thevalue of the deny lowerencryption
setting.
Returns the currentlyactive path to the caller
files.
Returns the value of the confirm connection
setting.
Returns thevalue of the deny lowerencryption
setting.
Returns the value of the disconnect iftimeout
setting.
Returns the valueof the make passwords case
sensitive setting.
ByteByte = <CHostDataEx>.PwAttempts
Returns the value of the limit login attempts
per call setting.
ByteByte = <CHostDataEx>.PwTimeout
Returns thevalue of the limit timeto complete
login setting (in minutes).
ByteByte = <CHostDataEx>.ActiveKbds
Returns the active keyboard and mouse
settings.
The following values are valid:
■ 0: Host and remote
■ 1: Host
■ 2: Remote
ByteByte = <CHostDataEx>. InactiveTimeout
Returns the number of minutes to wait before
disconnecting if the inactivity time limit
expires.
BoolBool = <CHostDataEx>.LockSystemWhileWait
Returns the lock host computer upon startup
setting.
Page 52
Visual Basic object definitions
52
CHostDataEx object
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
BoolBool = <CHostDataEx>.MinimizeOnLaunch
ByteByte = <CHostDataEx>.ConnLostWait
BoolBool = <CHostDataEx>.ConnLostHostOpts
BoolBool = <CHostDataEx>.ConnLostWait
ByteByte = <CHostDataEx>.AuthenticationType
Returns the run minimized on host startup
setting.
Returns the run host as a service setting.BoolBool = <CHostDataEx>.RunAsService
Returns the number of minutes to wait before
allowing another connection.
Returns whether to wait for another
connection or cancel the host if the session
ends abnormally.
The following values are valid:
■ FALSE: Wait
■ TRUE: Cancel host
Returns the value of the security option that
is setfor handlingan abnormalend of session.
Returns the number reference of the
authentication type.
The following values are valid:
■ 0: pcAnywhere
■ 1: pcAnywhere
■ 2: Windows
■ 3: NT
■ 4: pcAnywhere
■ 5: pcAnywhere
■ 6: ADS Active Directory Services
■ 7: Microsoft LDAP
■ 8: FTP
■ 9: HTTP
■ 10: HTTPS
■ 11: RSA SecurID
pcAnywhere authentication is used by default
if no authentication value is set or if the set
value is not valid (for example, the
authentication type is not available).
Page 53
CHostDataEx object
53Visual Basic object definitions
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
ByteByte = <CHostDataEx>.ConnLostSecurity
ByteByte = <CHostDataEx>.CallbkDelay
BoolBool = <CHostDataEx>.EndSessHostOpts
BoolBool = <CHostDataEx>.EnableEndSessSecurity
Returns the numeric representation of the
security level that is set for handling an
abnormal end of session.
The following values are valid:
■ 1: Log off user
■ 2: Restart host computer
■ 3: Lock computer
Returns the number of seconds to wait before
the host modem calls back the remote.
Returns whether the host waits for another
connection or is cancelled after a normal end
of session.
The following values are valid:
■ FALSE: Wait for next connection
■ TRUE: Cancel host
Returns whether the end of session security
options are enabled for a normal end of
session.
ByteByte = <CHostDataEx>.EndSessSecurity
Returns the security option that is set for a
normal end of session.
The following values are valid:
■ 1: Log off user
■ 2: Restart host computer
■ 3: Lock computer
Returns thescreen blanking option that isset.BoolBool = <CHostDataEx>.BlankHost
BoolBool = <CHostDataEx>.AllowRemoteMouse
Returns whetherthe remoteuser has keyboard
and mouse control during a session.
BoolBool = <CHostDataEx>.RebootOnDisconnect
Returns whether the host computer is
restarted after the session ends.
BoolBool = <CHostDataEx>.PasswordAfterDisc
Returns whether the host user is logged off
after the session ends.
BoolBool = <CHostDataEx>.LogFailures
Returns whether the log password failures
option is set.
Page 54
Visual Basic object definitions
54
CHostDataEx object
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
BoolBool = <CHostDataEx>.AllowDriveSecurity
BoolBool = <CHostDataEx>.UseDirectoryServices
Returns whether the drive security option is
enabled.
Returns whetherthe directoryservices option
is enabled.
Returns the directory service settings.StringString = <CHostDataEx>.DirectoryServiceEntry
Visual Basic sample code for host functionality
The following Visual Basic sample code retrieves a host data object and modifies
its properties:
Private Sub Command1_Click()
Dim HostDataManager as Object
Dim HostData as Object
Dim s as string
'Create CHostDataManager object
Set HostDataManager = CreateObject(WINAWSVR.BEHOSTDATAMANAGER)
The Awrem32 functions provide the parameters and return values for handling
connections between the host and remote computers.
Awrem32 function
awConnect(FileName)
awConnect
return value
Parameter =
Name as string
Boolean
DescriptionParameter or
The fully qualified .chf file name that
contains information about the host
computer
TRUE if command executedReturn value =
Page 56
Visual Basic object definitions
56
Awrem32 functions
Awrem32 function
awDisconnect()
FileXferFromHost(HostFile)
FileXferFromHost(RemoteFile)
FileXferFromHost
FileXferToHost(HostFile)
FileXferToHost(RemoteFile)
return value
Return value =
Boolean
Parameter =
HostFile as
string
Parameter =
RemoteFile as
string
Boolean
Parameter =
HostFile as
string
Parameter =
RemoteFile as
string
DescriptionParameter or
After calling this function, the calling
program must delete the object (C++ delete IAwrem32X*, VB - set ObjectName
= Nothing;)
Contains the fully qualified path and file
name tobe copied from the hostcomputer
Contains the fully qualified destination
path and file name. The HostFile and
RemoteFile strings do not have to be
identical
TRUE if command executedReturn value =
Copies a file from the remotecomputer to
the host computer. The parameters can
contain wildcard characters
The parametercontains the fully qualified
destination path and file name
Contains the fully qualified path and file
name to be copied from the remote
computer. The HostFile and RemoteFile
strings do not have to be identical
CreateFolderOnHost(FolderName)
CreateFolderOnHost
ExecuteHostFile(FileName)
Parmeter =
FolderName as
string
Boolean
Parameter =
FileName as
string
Contains the drive and path to create the
folder on the host computer
TRUE if command executedReturn value =
Executes an existing file on the host
computer. This function only executes
batch, command, and executable files. It
does not execute files that are associated
with executables. For example, this
function does not open Microsoft Word if
you execute a .doc file.
The parametercontains the fully qualified
path to the file on the host computer
Page 57
Awrem32 functions
57Visual Basic object definitions
Awrem32 function
ExecuteHostFile
GetError()
ConnectionStatus()
return value
Boolean
Return value =
String
Return value =
Short
DescriptionParameter or
TRUE if command executedReturn value =
Returns the last error generated in
Awrem32
Returns the current status of your
connection to the host computer
The possiblevalues include the following:
■ -1 = Lost connection
■ 0 = No connection
■ 1 = Session connected
Page 58
Visual Basic object definitions
58
Awrem32 functions
Page 59
Visual C++ object
definitions
This chapter includes the following topics:
■ About Visual C++ objects
■ CRemoteDataManager methods
■ CRemoteData object
■ CRemoteDataEx object
Chapter
3
■ CHostDataManager methods
■ CHostData object
■ CHostDataEx object
■ Awrem32 functions
About Visual C++ objects
The pcAnywhereAutomation Server provides the following components tosupport
OLE Automation:
Winawsvr
Awrem32
The objects that are described in Table 3-1 comprise Winawsvr.
Provides the information needed to connect to the pcAnywhere
Automation Server and access its interfaces
Provides the information needed to control pcAnywhere
connections
Page 60
Visual C++ object definitions
60
CRemoteDataManager methods
CRemoteDataManager
CRemoteData
CHostDataManager
CHostData
Table 3-1
Winawsvr objects
ReferenceDescriptionObject
Provides themethods forcreating, opening,
modifying, saving, and deleting
CRemoteData objects
Defines the parameters for accessing and
controlling pcAnywhere remote
functionality
Defines the parameters for accessing and
controlling pcAnywherehost functionality
See “CRemoteDataManager methods”
on page 60.
See “CRemoteData object” on page 63.
See “CRemoteDataEx object” on page 70.
See “CHostDataManager methods”
on page 71.
See “CRemoteData object” on page 63.
See “CRemoteDataEx object” on page 70.
Awrem32 has one object, which consists of eight interfaces to support remote
control and file transfer sessions.
See “Awrem32 functions” on page 85.
Some functionsare no longer supported. However, object definitions areprovided
for use with earlier versions.
For functionsthat require passwords, password values can be setbut not retrieved.
This is for security purposes.
CRemoteDataManager methods
The CRemoteDataManager methods provide the parameters and return values
for accessing and controlling CRemoteData objects.
Method
return value
BSTR CurrentDirectory();
BOOL
ChangeDirectory(LPCTSTR
lpszNewDirectory);
Parameter =
BSTR
Parameter =
LPCTSTR
lpszNewDirectory
Return value =
BOOL
DescriptionParameter or
The full path name of the current
pcAnywhere data directory in which
pcAnywhere remote objects are stored
Changes the current directory in which
pcAnywhere remote objects are stored.
Parameter is the name of an existing
directory
Return value is TRUE if successful
Page 61
CRemoteDataManager methods
61Visual C++ object definitions
Method
BOOL FindFirst(LPCTSTR
lpszPattern, BSTR FAR*);
BOOL
FindFirst(pbstrFullQualName);
BOOL FindFirst
BOOL FindNext(BSTR FAR*
pbstrFullQualName);
LPDISPATCH
RetrieveObject(LPCTSTR
lpszFQName);
return value
Parameter =
LPCTSTR
lpszPattern
Parameter =
BSTR FAR *
pbstrFullQualName
Return value =
BOOL
Parameter =
BSTR FAR *
pbstrFullQualName
Return value =
BOOL
Parameter =
LPCTSTR
lpszFQName
DescriptionParameter or
File name pattern to filterobject files (an
asterisk [*] finds all files in the current
directory)
Return buffer for the full path name of
the remote object file that matches the
specified pattern
TRUE if a remote object file matching
the specified pattern is found. The full
path name of the matching file is stored
in pbstrFullQualName
After FindFirst() has been successfully
called toget the name of aremote object
file in the current directory, FindNext()
can be called to find the next file that
matches the pattern, if any
Return value is TRUE if another remote
object filematching the pattern specified
in the call to FindFirst() is found. The
full path name of the matching file is
stored in pbstrFullQualName
Retrieves a CRemoteData object by file
name
Parameter is the fully qualified remote
object file name to be loaded
LPDISPATCH
RetrieveObject(short
wAccessMode);
LPDISPATCH
RetrieveObject(LPCTSTR
lpszPassword);
Parameter =
short
wAccessMode
LPCTSTR
lpszPassword
Specifies how this object is to be used.
This relates to the password protection.
The options are as follows:
Parameter is the fully qualified remote
object file name to be loaded
Specifies how this object is to be used.
This relates to the password protection.
The options are as follows:
■ 0 = Not specified
■ 1 = View only
■ 2 = View and Modify
■ 3 = Execute
Object password. May be NULLParameter =
Pointer to an OLE dispatch object. The
object is a CRemoteDataEx object.
See Visual C++ sample code for remote
functionality.
Creates a CRemoteData object and
returns an LPDISPATC pointer to it.
Parameter is the fully qualified remote
object file name for the new object
Return value is a pointer to an OLE
dispatch object. The object is a
CRemoteData object.
See Visual C++ sample code for remote
functionality.
Page 63
CRemoteData object
63Visual C++ object definitions
Method
LPDISPATCH
CreateObjectEx(LPCTSTR
lpszFQName);
BOOL DeleteObject(LPCTSTR
lpszFQName);
BOOL DeleteObject(LPCTSTR
lpszPassword);
BOOL Launch(LPCTSTR
lpszFQName);
return value
Parameter =
LPCTSTR
lpszFQName
Return value =
LPDISPATCH
Parameter =
LPCTSTR
lpszFQName
LPCTSTR
lpszPassword
Parameter =
LPCTSTR
lpszFQName
Return value =
BOOL
DescriptionParameter or
Creates a CRemoteDataEx object and
returns an LPDISPATCH pointer to it
Parameter is the fully qualified remote
object file name for the new object
Return value is a pointer to an OLE
dispatch object. The object is a
CRemoteDataEx object.
See Visual C++ sample code for remote
functionality.
Deletes a remote object file.
Parameter is the fully qualified remote
object file name of the object to be
deleted
Object password. May be NULLParameter =
TRUE if object is deletedBOOLBOOL DeleteObject
Launches a remote object file, which
opens the pcAnywhere remote terminal
window.
Parameter is the fully qualified remote
object file of object to be launched
Return value is TRUE if object is
successfully launched
CRemoteData object
Use this object to modify remote object data.
Get and Set methods
The following methods are used to get and set properties of the CRemoteData
object.
The computer name is the name of the pcAnywhere host computer to be called
when the remote object is launched.
Page 64
Visual C++ object definitions
64
CRemoteData object
BSTR GetComputerName();
void SetComputerName(LPCTSTR lpszNewValue);
The phone number is the number to dial to establish a modem connection to a
pcAnywhere host computer.
BSTR GetPhoneNumber();
void SetPhoneNumber(LPCTSTR lpszNewValue);
Indicates whether TAPI dialing properties should be used (location information)
(TRUE) or whether the phone number string should be used exactly as it appears
(FALSE).
BOOL GetUseDialingProperties();
void SetUseDialingProperties(BOOL bNewValue);
If dialingproperties are to be used,this is the area code of thenumber to be called.
BSTR GetAreaCode();
void SetAreaCode(LPCTSTR lpszNewValue);
If dialing properties are to be used, this is the country code of the number to be
called.
BSTR GetCountryCode();
void SetCountryCode(LPCTSTR lpszNewValue);
The number of times to retry dialing this number if the call fails.
short GetRedialCount();
void SetRedialCount(short nNewValue);
The time to wait (in seconds) between redial attempts.
short GetRedialDelay();
void SetRedialDelay(short nNewValue);
The login name to be sent to the host when a connection is made. If this is left
empty, the user is prompted for a login name on connection.
BSTR GetAutoLoginName();
void SetAutoLoginName(LPCTSTR lpszNewValue);
The login password to be sentto the host when a connection is made. If this is left
empty, the user is prompted for a password on connection.
BSTR GetAutoLoginPassword();
void SetAutoLoginPassword(LPCTSTR lpszNewValue);
Page 65
CRemoteData object
The password for this object.
BSTR GetPassword();
void SetPassword(LPCTSTR lpszNewValue);
The object can only be launched if the password is used (TRUE).
BOOL GetExecuteProtection();
void SetExecuteProtection(BOOL bNewValue);
The object can only be viewed if the correct password is provided (TRUE).
BOOL GetReadProtection();
void SetReadProtection(BOOL bNewValue);
The object can only be written if the correct password is provided (TRUE).
BOOL GetWriteProtection();
void SetWriteProtection(BOOL bNewValue);
Controls whether sessions using this object are logged.
BOOL GetLogSession();
void SetLogSession(BOOL bNewValue);
65Visual C++ object definitions
Controls whether sessions using this object are recorded from the beginning.
BOOL GetRecordSession();
void SetRecordSession(BOOL bNewValue);
The name of the record file for sessions using this object.
BSTR GetRecordFile();
void SetRecordFile(LPCTSTR lpszNewValue);
Sets the connection types.
BOOL GetRunOnConnect();
void SetRunOnConnect(BOOL bNewValue);
The following connection types are available:
■ COM1
■ COM2
■ COM3
■ COM4
■ ISDN via CAPI 2.0
Page 66
Visual C++ object definitions
66
CRemoteData object
■ NetBIOS
■ SPX
■ DEFAULT TAPI
■ TCP/IP
The name of a TAPI device can also be used as a connection type. DEFAULT TAPI
uses the first TAPI device found on the system. To use a specific TAPI device, use
FirstConnectionType() / NextConnectionType() to search for available devices.
Remote object Detail methods
When a remote object is assigned a connection type, the device details are set to
valid default values.
The following connection types have advanced configuration options that can be
set in your application:
■ COM devices
■ NetBIOS devices
■ ISDN via CAPI 2.0 (European ISDN only) devices
COM device details
Sets the communications parity level.
BSTR GetComParity();
void SetComParity(LPCTSTR lpszNewValue);
Communications parity values are as follows:
■ None
■ Odd
■ Even
■ Mark
■ Space
Sets the flow control level.
BSTR GetComFlowControl();
void SetComFlowControl(LPCTSTR lpszNewValue);
Flow control values are as follows:
■ <None>
Page 67
■ XONXOFF
■ RTS/CTS
■ BOTH
Sets the connection start setting.
BSTR GetComStartedBy();
void SetComStartedBy(LPCTSTR lpszNewValue);
Connection start values are as follows:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
■ Receive 2 <CR>'s
■ Modem response
CRemoteData object
67Visual C++ object definitions
Sets the connection end values.
BSTR GetComEndedBy();
void SetComEndedBy(LPCTSTR lpszNewValue);
Connection end values are as follows:
■ Always connected
■ Carrier detect (DCD)
■ Clear to send (CTS)
■ Data set ready (DSR)
■ Ring indicator (RI)
Sets the connection speed.
long GetComSpeed();
void SetComSpeed(long nNewValue);
Connection speed values are as follows:
■ 110
■ 300
■ 600
Page 68
Visual C++ object definitions
68
CRemoteData object
■ 1200
■ 2400
■ 4800
■ 9600
■ 19200
■ 38400
■ 57600
■ 115200
NetBIOS device details
Sets the LAN Adapter (LANA) number to use for this connection.
short GetLanaNumber();
void SetLanaNumber(short nNewValue);
ISDN via CAPI 2.0 device details
Activates channel bonding (uses two ISDN channels for one connection) if TRUE.
BOOL GetCapiChannelBonding();
void SetCapiChannelBonding(BOOL bNewValue);
Sets any additional CAPI extensions that are needed for communications.
BSTR GetCapiExtensions();
void SetCapiExtensions(LPCTSTR lpszNewValue);
Remote object methods
The following table describes the normal methods of the remote object (they are
not used to get and set properties):
Method
short ConnectionTypes();
return value
Return value =
Short
DescriptionParameter or
The number of connection types
available on this computer
Page 69
CRemoteData object
69Visual C++ object definitions
Method
BSTR
FirstConnectionType(); and
BSTR
NextConnectionType();
BSTR FirstCountryCode();
and BSTR
NextCountryCode();
return value
Return value =
BSTR
Parameter =
LPCTSTR
lpszConnectionTyp
Return value =
BOOL
Return value =
Short
Return value =
BSTR
DescriptionParameter or
FirstConnectionType() and
NextConnectionType() areused toiterate
through the available connection types.
These functions return a BSTR,which is
the name of an available connection
type. You can use these returned
connection types with the
SetConnectionType() function.
The return value is the name of a
supported connection device type
The name of a connection device type
The return value is TRUE if the
connection type that is passed in exists
on the computer
Returns the number of country codes
available
FirstCountryCode() and
NextCountryCode() are used to iterate
through the available country codes.
These functions return a BSTR,which is
the name of an available country code.
You can use these returned values with
the SetCountryCode() function
The return value is the first or next
country code string
BOOL ReadObject(LPCTSTR
lpszPassword);
BOOL WriteObject(LPCTSTR
lpszPassword);
Parameter =
LPCTSTR
lpszPassword
Return value =
BOOL
Parameter =
LPCTSTR
lpszPassword
Return value =
BOOL
Reads the object data from the remote
object file
The parameter is the object password
The return value is TRUE if object is
successfully read
Writes the object data out to the remote
object file.
The parameter is the object password
The return value is TRUE if object is
successfully written
Page 70
Visual C++ object definitions
70
CRemoteDataEx object
CRemoteDataEx object
The CRemoteDataEx object contains the same functionality as the CRemoteData
object with the following additional Get and Set methods:
BSTR GetPrivateKey(); //Returns the PrivateKey information
void SetPrivateKey(LPCTSTR lpszNewValue);
BSTR GetCertificationName(); //Returns the Certification Name
void SetCertificationName(LPCTSTR lpszNewValue);
short GetEncryptionLevel(); //Returns the encryption level value
void SetEncryptionLevel(short nNewValue);
BOOL GetDenyLowerEncrypt(); //Returns the DenyLowerEncrypt value
void SetDenyLowerEncrypt(BOOL bNewValue);
BSTR GetAutoDomain(); //Returns the AutoDomain value
void SetAutoDomain(LPCTSTR lpszNewValue);
Visual C++ sample code for remote functionality
The following sample C++ function creates a remote object, sets its connection
type to TCP/IP, sets the computer name to the TCP/IP address passed into the
function, and then launches the remote object:
The following table describes the CHostDataManager methods, including the
parameters and return values for accessing and controlling CHostData objects:
CHostDataManager methods
71Visual C++ object definitions
Method
BOOL
ChangeDirectory(LPCTSTR
lpszNewDirectory);
return value
Return value= BSTRBSTR CurrentDirectory();
Parameter =
LPCTSTR
lpszNewDirectory
Return value =
BOOL
DescriptionParameter or
Returns the full path name of the
current directoryin which pcAnywhere
host objects are stored
Changes the currentdirectory in which
pcAnywhere host objects are stored
The parameter is name of an existing
directory
The return value is TRUE if successful
Page 72
Visual C++ object definitions
72
CHostDataManager methods
Method
BOOL FindFirst(LPCTSTR
lpszPattern);
BOOL FindFirst(BSTR
FAR* pbstrFullQualName);
BOOL FindNext(BSTR
FAR* pbstrFullQualName);
return value
Parameter =
LPCTSTR
lpszPattern
Return value =
BOOL
Parameter = BSTR
FAR *
pbstrFullQualName
Parameter = BSTR
FAR *
pbstrFullQualName
Return value =
BOOL
DescriptionParameter or
Finds the first pcAnywhere host object
file (*.bhf) in the current directory,
based onthe specified file name pattern
The parameter is the File name pattern
to filter object files (an asterisk [*] finds
all host files in the current directory)
The returnvalue is TRUE if ahost object
file matching the specified pattern is
found. The full path name of the
matching file is stored in
pbstrFullQualName
Return buffer for the full path name of
the remote object file that matches the
specified pattern
The returnvalue is TRUE if ahost object
file matching the specified pattern is
found. The full path name of the
matching file is stored in
pbstrFullQualName.
After FindFirst() has been successfully
called to get the name of a host object
file in the current directory, FindNext()
can be called to find the next file that
matches the pattern, if any
The parameter is the return buffer for
the fullpath nameof thehost objectfile
that matches the pattern specified in
the original call to FindFirst()
The return value is TRUE if another
host object file matching the pattern
specified in the call to FindFirst() is
found. The full path name of the
matching file is stored in
pbstrFullQualName
LPDISPATCH
RetrieveObject(LPCTSTR
lpszFQName);
Parameter =
LPCTSTR
lpszFQName
Retrieves a CHostData object by file
name.
The parameteris the fully qualified host
object file name to be loaded
Page 73
CHostDataManager methods
73Visual C++ object definitions
Method
LPDISPATCH
RetrieveObject(short
wAccessMode);
LPDISPATCH
RetrieveObject(LPCTSTR
lpszPassword);
LPDISPATCH
RetrieveObject
LPDISPATCH
RetrieveObjectEx(LPCTSTR
lpszFQName);
LPDISPATCH
RetrieveObjectEx(short
wAccessMode);
return value
Parameter = short
wAccessMode
LPCTSTR
lpszPassword
Return value =
LPDISPATCH
Parameter =
LPCTSTR
lpszFQName
Parameter = short
wAccessMode
DescriptionParameter or
Specifies how this object is to be used.
This relatesto the password protection.
The options are as follows:
■ 0 = Not specified
■ 1 = View only
■ 2 = View and Modify
■ 3 = Execute
Object password. May be NULLParameter =
Pointer to an OLE dispatch object. The
object is a CHostData object.
See Visual C++ sample code for host
functionality.
Retrieves a CHostDataEx object by file
name
The parameteris the fully qualified host
object file name to be loaded
Specifies how this object is to be used.
This relatesto the password protection.
The options are as follows:
Pointer to an OLE dispatch object. The
object is a CHostDataEx object
See Visual C++ sample code for host
functionality.
Page 74
Visual C++ object definitions
74
CHostDataManager methods
Method
LPDISPATCH
CreateObject(LPCTSTR
lpszName);
LPDISPATCH
CreateObjectEx(LPCTSTR
lpszName);
BOOL
DeleteObject(LPCTSTR
lpszFQName);
return value
Parameter =
LPCTSTR
lpszFQName
Return value =
LPDISPATCH
Parameter =
LPCTSTR
lpszFQName
Return value =
LPDISPATCH
Parameter =
LPCTSTR
lpszFQName
DescriptionParameter or
Creates a CHostData object and returns
an LPDISPATCH pointer to it
The parameteris the fully qualified host
object file name for the new object
The return value is a pointer to an OLE
dispatch object. The object is a
CHostData object
See Visual C++ sample code for host
functionality.
Creates a CHostDataEx object and
returns an LPDISPATCH pointer to it
The parameteris the fully qualified host
object file name for the new object
The return value is a pointer to an OLE
dispatch object. The object is a
CHostDataEx object.
See Visual C++ sample code for host
functionality.
Deletes a host object file
The parameteris the fully qualified host
object file name of the object to be
deleted
BOOL
DeleteObject(LPCTSTR
lpszPassword);
BOOL DeleteObject
BOOL Launch(LPCTSTR
lpszFQName);
LPCTSTR
lpszPassword
BOOL
Parameter =
LPCTSTR
lpszFQName
Return value =
BOOL
Object password. May be NULLParameter =
TRUE if object is deletedReturn value =
Launches ahost object file, which opens
the pcAnywhere host terminal window
The parameteris the fully qualified host
object file of the object to be launched
The return value is TRUE if object is
successfully launched
Page 75
CHostData object
Use this object to modify host object data.
Get and Set methods
The following methods are usedto get and set properties of the CHostData object.
The phone number is the number to dial to establish a modem connection to a
pcAnywhere remote computer.
BSTR GetPhoneNumber();
void SetPhoneNumber(LPCTSTR lpszNewValue);
Indicates whether TAPI dialing properties should be used (location information)
(TRUE) or whether the phone number string should be used exactly as it appears
(FALSE).
BOOL GetUseDialingProperties();
void SetUseDialingProperties(BOOL bNewValue);
If dialingproperties are to be used,this is the area code of thenumber to be called.
CHostData object
75Visual C++ object definitions
BSTR GetAreaCode();
void SetAreaCode(LPCTSTR lpszNewValue);
If dialing properties are to be used, this is the country code of the number to be
called.
BSTR GetCountryCode();
void SetCountryCode(LPCTSTR lpszNewValue);
The number of times to retry dialing this number if the call fails.
short GetRedialCount();
void SetRedialCount(short nNewValue);
The time to wait (in seconds) between redial attempts.
short GetRedialDelay();
void SetRedialDelay(short nNewValue);
Controls whether sessions using this object are logged.
BOOL GetLogSession();
void SetLogSession(BOOL bNewValue);
Controls whether sessions using this object are recorded from the beginning.
Page 76
Visual C++ object definitions
76
CHostData object
BOOL GetRecordSession();
void SetRecordSession(BOOL bNewValue);
The name of the record file for sessions using this object.
BSTR GetRecordFile();
void SetRecordFile(LPCTSTR lpszNewValue);
Host object Detail methods
When a host object is assigned a connection type, the device details are set to
valid default values.
The following connection types have advanced configuration options that can be
set in your application:
■ COM devices
■ NetBIOS devices
■ NASI/NCSI devices
■ ISDN via CAPI 2.0 (European ISDN only) devices
COM device details
The following code places the requested connection type on the host object’s list
of assigned connection types and makes it the current connection type when
processing subsequent device-specific method calls:
BOOL AssignConnection(LPCTSTR lpszNewValue);
If the requested connection type is already on the list of assigned connections,
the list of assigned connections does not change. Only the current connection
type is changed to the requested type. It is normal to call the AssignConnection
method on the same object multiple times in the course of getting and setting
connection-specific values.
AssignConnection returns TRUE if the connection type that ispassed in exists on
the computer and is either successfully assigned or already assigned. It returns
FALSE if either the requested connection type does not exist on the computer or
the current assigned connection count is already at the maximum allowed level.
A pcAnywhere host object can support up to two assigned connection types. The
AssignConnection method returns FALSE if it detects an attempt to exceed this
limit.
The following connection types are available:
■ COM1
Page 77
CHostData object
■ COM2
■ COM3
■ COM4
■ SPX
■ NetBIOS
■ TCP/IP
■ ISDN via CAPI 2.0
■ DEFAULT TAPI
The name of a TAPI device can also be used as a connection type. DEFAULT TAPI
uses the first TAPI device found in the system. To use a specific TAPI device, use
FirstConnectionType() andNextConnectionType() tosearch foravailable devices.
The following code unassigns a connection type. After unassigning a connection
type, the remaining assigned connection, if any, becomes the current connection
type for subsequent device-specific method calls.
BOOL UnassignConnection(LPCTSTR lpszNewValue);
77Visual C++ object definitions
The following code sets the communications parity levels:
Returns the number of connection types
available on this computer
FirstConnectionType() and
NextConnectionType() are used to iterate
through the available connection types.
The functionsreturn aBSTR, which isthe
name ofan available connection type. You
can use these returned connection types
with the SetConnectionType() function
The return value is the name of a
supported connection device type
The parameter is the name of a
connection device type
The return value is TRUE if this device
type is available
Page 81
CHostData object
81Visual C++ object definitions
Method
short
MaxAssignedConnections()
short
AssignedConnections()
BSTR
FirstAssignedConnection();
and BSTR
NextAssignedConnection();
Returns the maximum number of
connection types that can be assigned at
the same time (currently two)
Returns the number of assigned
connection types.
FirstAssignedConnection() and
NextAssignedConnection() are used to
iterate through the list of assigned
connections. These functions return a
BSTR, which is the name of an assigned
connection type. You can use these
returned connection types with the
AssignConnection() function
The return value is the name of a
supported connection device type
The parameter is the name of a
connection device type
The return value is TRUE if this device
type is currently assigned
short CountryCodes();
BSTR FirstCountryCode();
and BSTR
NextCountryCode();
BOOL ReadObject(LPCTSTR
lpszPassword);
Return value =
Short
Return value =
BSTR
Parameter =
LPCTSTR
lpszPassword
Return value =
BOOL
Returns the number of country codes
available
FirstCountryCode() and
NextCountryCode() are used to iterate
through the list of available country
codes. Thefunctions returna BSTR, which
is the name of an available country code.
You can use these returned values with
the SetCountryCode() function.
The return value is the first or next
country code string
Reads theobject data from the hostobject
file
The parameter is the object password
The return value is TRUE if object is
successfully read
Page 82
Visual C++ object definitions
82
CHostDataEx object
Method
BOOL
WriteObject(LPCTSTR
lpszPassword);
CHostDataEx object
The CHostDataEx object contains the same functionality as the CHostData object
with the following additional Get and Set methods:
Writes the object data out to the host
object file
The parameter is the object password
The return value is TRUE if object is
successfully written
Page 83
short GetAuthenticationType();
void SetAuthenticationType(short nNewValue);
BOOL GetLockSystemWhileWait();
void SetLockSystemWhileWait(BOOL bNewValue);
BOOL GetMinimizeOnLaunch();
void SetMinimizeOnLaunch(BOOL bNewValue);
BOOL GetRunAsService();
void SetRunAsService(BOOL bNewValue);
short GetConnLostWait();
void SetConnLostWait(short nNewValue);
BOOL GetConnLostHostOpts();
void SetConnLostHostOpts(BOOL bNewValue);
BOOL GetEnableConnLostSecurity();
void SetEnableConnLostSecurity(BOOL bNewValue);
short GetConnLostSecurity();
void SetConnLostSecurity(short nNewValue);
short GetCallbkDelay();
void SetCallbkDelay(short nNewValue);
BOOL GetEndSessHostOpts();
void SetEndSessHostOpts(BOOL bNewValue);
BOOL GetEnableEndSessSecurity();
void SetEnableEndSessSecurity(BOOL bNewValue);
short GetEndSessSecurity();
void SetEndSessSecurity(short nNewValue);
BSTR GetCryptPrivateKey();
void SetCryptPrivateKey(LPCTSTR lpszNewValue);
BSTR GetCryptCommonName();
void SetCryptCommonName(LPCTSTR lpszNewValue);
BOOL GetBlankHost();
void SetBlankHost(BOOL bNewValue);
BOOL GetAllowRemoteMouse();
void SetAllowRemoteMouse(BOOL bNewValue);
short GetRebootOnDisconnect();
void SetRebootOnDisconnect(short nNewValue);
BOOL GetPasswordAfterDisc();
void SetPasswordAfterDisc(BOOL bNewValue);
BOOL GetLogFailures();
void SetLogFailures(BOOL bNewValue);
BOOL GetAllowDriveSecurity();
void SetAllowDriveSecurity(BOOL bNewValue);
BOOL GetExecuteProtection();
void SetExecuteProtection(BOOL bNewValue);
CHostDataEx object
83Visual C++ object definitions
Page 84
Visual C++ object definitions
84
CHostDataEx object
Visual C++ sample code for host functionality
The followingsample Visual C++ function creates a host object,sets its connection
type to TCP/IP, sets the computer name to the TCP/IP address that is passed into
the function, and then launches the host object:
The following table describes the Awrem32 functions, including the parameters
and returnvalues for handling connections betweena host and remote computer:
Awrem32 functions
85Visual C++ object definitions
Method
boolean awConnect(BSTR
FileName);
boolean awDisconnect();
boolean
FileXferFromHost(BSTR
HostFile);
boolean
FileXferFromHost(BSTR
RemoteFile);
return value
Parameter =Name
as string
Return value =
Boolean
Return value =
Boolean
Parameter =
HostFile as string
Parameter =
RemoteFile as
string
DescriptionParameter or
Creates the connection to the host
computer
The parameteris thefully qualified.chf
file name that contains information
about the host computer
The returnvalue executesthe command
Disconnects the host computer
After calling this function, the calling
program must delete the object (C++ delete IAwrem32X*, VB – set
ObjectName = Nothing;)
Copies a file from the host computer to
the remote computer. The parameters
can contain wildcard characters
The parameter contains the fully
qualified pathand file name to becopied
from the host computer. The HostFile
and RemoteFile strings do not have to
be identical
Copies a file from the host computer to
the remote computer. The parameters
can contain wildcard characters
The parameter contains the fully
qualified destinationpath and file name.
The HostFileand RemoteFile strings do
not have to be identical.
boolean FileXferFromHost
TRUE if command executedReturn value =
Boolean
Page 86
Visual C++ object definitions
86
Awrem32 functions
Method
boolean
FileXferToHost(BSTR
HostFile);
boolean
FileXferToHost(BSTR
RemoteFile);
boolean FileXferToHost
boolean
CreateFolderOnHost(BSTR
FolderName);
return value
Parameter =
HostFile as string
Parameter =
RemoteFile as
string
Boolean
Parameter =
FolderName as
string
Return value =
Boolean
DescriptionParameter or
Copies a file from the remote computer
to the host computer. The parameters
can contain wildcard characters
The parameter contains the fully
qualified destinationpath and file name.
The HostFileand RemoteFile strings do
not have to be identical
Copies a file from the remote computer
to the host computer. The parameters
can contain wildcard characters
The parameter contains the fully
qualified pathand file name to becopied
from theremote computer.The HostFile
and RemoteFile strings do not have to
be identical
TRUE if command executedReturn value =
Creates a new folder on the host
computer. This function creates a
temporary folder on the remote
computer, and then copies that folder
to the host computer
The parameter contains the drive and
path to create the folder on the host
computer
The return value is TRUE if command
executed
Page 87
Awrem32 functions
87Visual C++ object definitions
Method
boolean
ExecuteHostFile(BSTR
FileName);
BSTR GetError();
short ConnectionStatus();
return value
Parameter
=FileName as
string
Return value =
Boolean
Return value =
String
Return value =
Short
DescriptionParameter or
Executes an existing file on the host
computer. This function only executes
batch, command, and executable files.
It does not execute files that are
associated with executables. For
example, it does not open Microsoft
Word if you execute a .doc file
The parameter contains the fully
qualified path to the file on the host
computer
The return value is TRUE if command
executed
Returns the last error generated in
Awrem32 as a string
Returns the current status of your
connection to the host computer