Symantec PCANYWHERE - OLE AUTOMATION GUIDE V 12.5, OLE Automation User Manual

OLE Automation Guide
OLE Automation Guide
Legal Notice
Copyright © 2008 Symantec Corporation. All rights reserved.
Symantec, the Symantec Logoare trademarks or registered trademarks of Symantec Corporation or its affiliates in the U.S. and other countries. Other names may be trademarks 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 areavailableunder open source or free software licenses.TheLicense Agreement accompanying the Software does not alter any rights or obligations you may have under those opensource or free software licenses. Please seetheThird Party Legal 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"AND ALLEXPRESS ORIMPLIED 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 CORPORATION SHALL NOT BE LIABLE FOR INCIDENTAL 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 deemedto be commercial computer software as definedin FAR 12.212 andsubject to restricted rights as defined in FARSection 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 theLicensed Software and Documentationby the U.S. Government shall be solely in accordance with the terms of this Agreement.
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
Technical Support
Symantec Technical Support maintains support centers globally. Technical Supports primary role is to respond to specific queries about product features and functionality.The Technical Support group also creates contentfor our 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 with Product Engineering and SymantecSecurity Response to provide alerting services and virus definition updates.
Symantecs 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 Symantecs 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 the computeron whichthe problem occurred, in case itis 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
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 registrationor a 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
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:
contractsadmin@symantec.comAsia-Pacific and Japan
semea@symantec.comEurope, Middle-East, and Africa
supportsolutions@symantec.comNorth America and Latin America
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:
These solutions provide early warning of cyber attacks, comprehensive threat analysis, and countermeasures to prevent attacks before they occur.
Symantec EarlyWarning Solutions
These servicesremove the burden of managingand monitoring security devices and events, ensuring rapid response to real threats.
Managed Security Services
Symantec Consulting Services provide on-site technical expertise from Symantec andits trusted partners. Symantec ConsultingServices offer a variety of prepackaged and customizable options that include assessment, design, implementation, monitoring,and management capabilities. Each is focused on establishing andmaintaining the integrity andavailability of your IT resources.
Consulting Services
Educational Services provide a full array of technical training, security education, security certification, and awareness communication programs.
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.
Technical Support ...... . . . ........... . . . ........... . . . ........... . . . ........... . . . ........... . . . ........... . . . .. 4
Chapter 1 Using OLE Automation with Symantec
pcAnywhere . . . ............ . . ........... . . . ........... . . . ........... . . . ........... 9
About OLE Automation ... . . . ........... . . ............ . . ............ . . ............ . . ...... 9
About the pcAnywhere Automation Server ..... . . . ........... . . . ........... . . . ... 10
What you can do with the pcAnywhere Automation Server . ............ . . ... 10
Before you start ............ . . . ........... . . . ........... . . . ........... . . ............ . . ..... 11
Automatically registering the remote engine ... . . . ........... . . . ........... 11
Manually registering the remote engine ......... . . . ........... . . . ........... 11
Accessing the pcAnywhere Automation Server .... . . ............ . . ........ 12
Accessing the pcAnywhere Automation Server with Visual
Basic .... . . ........... . . . ........... . . . ........... . . . ........... . . . ........... . . . .. 12
Accessing the pcAnywhere Automation Server with Visual
C++ ............ . . ............ . . ............ . . ............ . . ........... . . . ......... 13
Launching host and remote OLE objects .... . . ............ . . ............ . . ... 15
Where to find more information . . . . ........... . . . ........... . . . ........... . . . ....... 15
Chapter 2 Visual Basic object definitions ......... . . . ........... . . . ........... . . . . 17
About Visual Basic objects . ........... . . . ........... . . . ........... . . . ........... . . . .... 17
CRemoteDataManager methods ........... . . . ........... . . . ........... . . . ........... . 18
CRemoteData properties .......... . . ........... . . . ........... . . . ........... . . . .......... 21
Connection type properties .... . . . ........... . . . ........... . . . ........... . . ...... 23
Dialing properties .......... . . ............ . . ............ . . ............ . . ............ 25
COM device properties .......... . . ............ . . ............ . . ............ . . ...... 26
NetBIOS device properties ...... . . . ........... . . . ........... . . . ........... . . . .... 29
ISDN via CAPI 2.0 device properties ..... . . . ........... . . . ........... . . . ....... 30
CRemoteDataEx object .... . . . ........... . . . ........... . . . ........... . . . ........... . . . ... 31
Visual Basic sample code for remote functionality . . ............ . . ........ 32
CHostDataManager methods ............. . . ............ . . ............ . . ............ . . . 34
CHostData properties . ........... . . . ........... . . . ........... . . . ........... . . . .......... 36
Connection type properties .... . . . ........... . . . ........... . . . ........... . . ...... 38
AssignConnection(ConnectionType) method .. . . ............ . . ............ . 41
UnassignConnection(ConnectionType) method .......... . . ............ . . .. 41
Dialing properties .......... . . ............ . . ............ . . ............ . . ............ 42
Contents
COM device properties .......... . . ............ . . ............ . . ............ . . ...... 42
NetBIOS device properties ...... . . . ........... . . . ........... . . . ........... . . . .... 45
ISDN via CAPI 2.0 device properties ..... . . . ........... . . . ........... . . . ....... 46
CHostDataEx object ...... . . ............ . . ............ . . ............ . . ............ . . ...... 47
Visual Basic sample code for host functionality .... . . . ........... . . . ...... 54
Awrem32 functions . . . . ........... . . . ........... . . . ........... . . . ........... . . ........... 55
Chapter 3 Visual C++ object definitions ....... . . . ........... . . . ........... . . . ..... 59
About Visual C++ objects . . ........... . . . ........... . . . ........... . . . ........... . . . ..... 59
CRemoteDataManager methods ........... . . . ........... . . . ........... . . . ........... . 60
CRemoteData object .. . . ........... . . . ........... . . . ........... . . . ........... . . . ......... 63
Get and Set methods .......... . . ............ . . ............ . . ............ . . ......... 63
Remote object Detail methods ............ . . ............ . . ............ . . ........ 66
Remote object methods ........ . . . ........... . . . ........... . . . ........... . . . ...... 68
CRemoteDataEx object .... . . . ........... . . . ........... . . . ........... . . . ........... . . . ... 70
Visual C++ sample code for remote functionality ...... . . . ........... . . . .. 70
CHostDataManager methods ............. . . ............ . . ............ . . ............ . . . 71
CHostData object ... . . . ........... . . . ........... . . . ........... . . . ........... . . ............ 75
Get and Set methods .......... . . ............ . . ............ . . ............ . . ......... 75
Host object Detail methods . ........... . . . ........... . . . ........... . . . ........... 76
Host object methods .......... . . . ........... . . . ........... . . . ........... . . . ........ 80
CHostDataEx object ...... . . ............ . . ............ . . ............ . . ............ . . ...... 82
Visual C++ sample code for host functionality ....... . . ............ . . ...... 84
Awrem32 functions . . . . ........... . . . ........... . . . ........... . . . ........... . . ........... 85
Index ...... . . . ........... . . . ........... . . . ........... . . . ........... . . . ........... . . . ........... . . ............ . . .......... 89
Contents8
Using OLE Automation with Symantec pcAnywhere
This chapter includes the following topics:
About OLE Automation
About the pcAnywhere Automation Server
What you can do with the pcAnywhere Automation Server
Before you start
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:
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.
OLE Automation server
1
Chapter
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 supportsOLE Automation. The two most common programming languages are Microsoft Visual Basic and Microsoft Visual C++.
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.
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, whenyou create a host object using the pcAnywhere Automation Server and then enumerate through the list of assignedconnections, the first available modem TAPI deviceis already assigned.
What you can do with the pcAnywhere Automation Server
The pcAnywhereAutomation Server lets youautomate a variety ofadministrative 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
Using OLE Automation with Symantec pcAnywhere
About the pcAnywhere Automation Server
10
This document containsseveral examples, written in both Visual Basicand 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 exposed interface. 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 whichSymantec pcAnywhere 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.
Automatically registering the remote engine
Before you connect to another computer for the first time using your OLE client, you must self-register the remote engine. Youcan do this automatically whenyou start a remote object in Symantec pcAnywhere.
To automatically register the remote engine
1
To open Symantec pcAnywhere, do one of the following:
On the desktop, double-click the Symantec pcAnywhere program icon.
On theWindows taskbar, click Start> Programs > Symantec pcAnywhere.
2
In the pcAnywhere Manager window, click Remotes.
3
Double-click a remote connection item.
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
11Using OLE Automation with Symantec pcAnywhere
Before you start
pcAnywhere Automation Server executable file (Winawsvr.exe). You only need to runthe executable file once to add the GUIDs tothe 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 Visual Basicprogramming language has built-in supportto interact with OLE 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
1
Add a pair of Object variables for each pcAnywhere object that you want to access.
For example,when working with remote objects,DIM a RemoteDataManager and a RemoteDataObject as Object.
2
Use the RemoteDataManager to attach to the remote objects data manager.
For example, call the CreateObject method with WINAWSVR.REMOTEDATAMANAGER as a parameter.
Visual Basic uses the textual parameter to locate the managers identifier in the registry and returns the interface to that manager.
3
Once there is a valid data manager object, use it to do any of the following:
Determine the current directory.
Change to another directory.
Enumerate the associated data object files in the current directory.
Using OLE Automation with Symantec pcAnywhere
Before you start
12
Create, retrieve, or delete a data object file.
4
After a data object is created or retrieved, you can get or set properties of the
object.
The Visual Basic syntax does not use a propertys name to differentiate
between getting and setting its value. Instead, the propertys 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 objects phone number value, place the property name to the
right of the assignment operator. For example,s = RemoteData.PhoneNumber(), where s is astring variable.
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 that isneeded to obtain an interface to thepcAnywhere Automation Server and perform high-level operations on the interfaces associated object type.
Use the data manager object to do the following:
Determine or change the current directory.
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 associateddata object 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 objects current phone number property and calls SetPhoneNumber to set it.
Importing and viewing classes
The pcAnywhere Automation Server uses the following type libraries:
13Using OLE Automation with Symantec pcAnywhere
Before you start
Provides the information needed to connect to the pcAnywhere Automation Server and access its interfaces
Winawsvr.tlb
Provides the information needed to control pcAnywhere connectionsAwrem32.tlb
The following procedures explain how to import the class definitions from the pcAnywhere AutomationServer type libraries intoyour MFC application andthen view the classes that have been added to your application.
To import classes
1
In Visual C++, create an MFC application.
2
On the View menu, click Class Wizard.
3
In the Class Wizard dialog box, click Add Class, and then click From a type library.
4
Double-click winawsvr.tlb.
5
In the Confirm Classes dialog box, click OK to import all class definitions.
6
In the Class Wizard dialog box, click Add Class, and then click From a type library.
7
Double-click awrem32.tlb.
8
In the Confirm Classes dialog box, click OK to import all class definitions.
9
In the Class Wizard dialog box, click OK to complete the import process.
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 containthe class definitions and implementation source code for the pcAnywhere Automation Server.
See “Viewing the class definitions and implementation files” on page 14.
To view the added classes
1
In Visual C++, open your MFC application.
2
In the Workspace window, click the ClassView tab.
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
Using OLE Automation with Symantec pcAnywhere
Before you start
14
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
1
In Visual C++, open your MFC application.
2
In the Workspace window, click the FileView tab.
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 or remote 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
For more information about OLE automation, see the following references:
Box, Don. 1998. Essential COM. Reading, Mass.: Addison-Wesley.
Horton, Ivor. 1997. Beginning MFC Programming. Birmingham, UK.: Wrox
Press.
Rogerson, Dale. 1997. Inside COM. Redmond, Wash.: Microsoft Press.
Templeman, Julian. 1997. Beginning MFC COM Programming. Birmingham,
UK.: Wrox Press.
15Using OLE Automation with Symantec pcAnywhere
Where to find more information
Using OLE Automation with Symantec pcAnywhere
Where to find more information
16
Visual Basic object definitions
This chapter includes the following topics:
About Visual Basic objects
CRemoteDataManager methods
CRemoteData properties
CRemoteDataEx object
CHostDataManager methods
CHostData properties
CHostDataEx object
Awrem32 functions
About Visual Basic objects
The pcAnywhereAutomation Server provides the followingcomponents to support OLE Automation:
Provides the information needed to connect to the pcAnywhere Automation Server and access its interfaces
Winawsvr
Provides the information needed to control pcAnywhere connectionsAwrem32
Table 2-1 describes the objects that comprise Winawsvr.
2
Chapter
Table 2-1
Winawsvr objects
ReferenceDescriptionObject
See “CRemoteDataManager methods” on page 18.
Provides themethods for creating, opening, modifying, saving, and deleting CRemoteData objects
CRemoteDataManager
See “CRemoteData properties” on page 21.
See “CRemoteDataEx object” on page 31.
Defines the parameters for accessing and controlling pcAnywhere remote functionality
CRemoteData
See “CHostDataManager methods” on page 34.
Provides themethods for creating, opening, modifying, saving,and deleting CHostData objects
CHostDataManager
See “CHostData properties” on page 36.
See “CHostDataEx object” on page 47.
Defines the parameters for accessing and controlling pcAnywherehost functionality
CHostData
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 definitionsare provided for use with earlier versions of pcAnywhere.
For functionsthat require passwords, password values can beset but 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 methods
DescriptionParameter or return
value
CRemoteDataManager method
Returns the full path name of the current directory in which pcAnywhere remote objects are stored
Return Value = StringCurrentDirectory()
Changes the current directory in which pcAnywhere remote objects are stored
Parameter = NewDirectory
ChangeDirectory(NewDirectory)
Visual Basic object definitions
CRemoteDataManager methods
18
Table 2-2
CRemoteDataManager methods (continued)
DescriptionParameter or return
value
CRemoteDataManager method
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 [*] finds all files in the current directory)
Parameter =Pattern as string
FindFirst(Pattern)
Return bufferfor the full path name of the remote object file (*chf) that matches the specified pattern
Parameter = Name as string
FindFirst(Name string)
Return bufferfor the full path name of the remote object file that matches thepattern that is specified in the original call to FindFirst()
Parameter = Name as string
FindNext(Name)
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
Return value= BooleanFindNext(Name)
The fullyqualified remote object file name to be loaded
Parameter = Name as string
RetrieveObject(Name)
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
Parameter = AccessMode as integer
RetrieveObject(AccessMode)
Object password. May be NULLParameter = Password
as string
RetrieveObject(Password)
The fullyqualified remote object file name to be loaded
Parameter = Name as string
RetrieveObjectEx(Name)
19Visual Basic object definitions
CRemoteDataManager methods
Table 2-2
CRemoteDataManager methods (continued)
DescriptionParameter or return
value
CRemoteDataManager method
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
Parameter = AccessMode as integer
RetrieveObjectEx(AccessMode)
Object password. May be NULLParameter = Password
as string
RetrieveObjectEx(Password)
CRemoteDataEx object from the specified file
Return value = ObjectRetrieveObjectEx
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
Parameter = Name as string
CreateObject(Name)
CRemoteDataReturn value = ObjectCreateObject
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
Parameter = Name as string
CreateObjectEx(Name)
CRemoteDataExReturn value = ObjectCreateObjectEx
The fullyqualified remote object file name of the object to be deleted
Parameter = Name as string
DeleteObject(Name)
Object passwordParameter = Password
as string
DeleteObject(Password)
TRUE if object is deletedReturn value= BooleanDeleteObject
Visual Basic object definitions
CRemoteDataManager methods
20
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.
Table 2-3
CRemoteData properties and parameters
DescriptionParameterProperty
Sets the computer name or IP address of the host computer.
String<CRemoteData>.ComputerName(String)
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.
Integer<CRemoteData>.RedialCount(Integer)
Sets the number of seconds to wait between redial attempts.
Integer<CRemoteData>.RedialDelay(Integer)
Sets the name of the user for automatic login.
For more information about using domain logins:
See “CRemoteDataEx object” on page 31.
String<CRemoteData>.AutoLoginName(String)
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>.AutoLoginPassword(String)
Sets the passwordon theremote 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.
String<CRemoteData>.Password(String)
Sets the requirement of a password to execute the object. Set by Password.
Bool<CRemoteData>.ExecuteProtection(Bool)
21Visual Basic object definitions
CRemoteData properties
Table 2-3
CRemoteData properties and parameters (continued)
DescriptionParameterProperty
Sets therequirement of a password to view the properties of the remote object. Set by Password.
Bool<CRemoteData>.ReadProtection(Bool)
Sets the requirement of a password to save changes tothe remote object. Set by Password.
Bool<CRemoteData>.WriteProtection(Bool)
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.
String<CRemoteData>.RecordFile(String)
Activates and deactivates automatic session recording.
Bool<CRemoteData>.RecordSession(Bool)
Sets the password of the object. Use this property to refresh the local data copy of the remote object.
String<CRemoteData>.ReadObject(String)
Sets the password of the object. Use this property tocreate the remote object or to write changes that you have made to the remote object.
String<CRemoteData>.WriteObject(String)
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
Returns the computer name or IP address of the host computer
StringString = <CRemoteData>.ComputerName
Returns the phone number of the host computer
StringString = <CRemoteData>.PhoneNumber
Returns thesystem dialingproperties that are set in the remote object
BoolBool = <CRemoteData>.UseDialingProperties
Returns the number of redial attempts that is set in the remote object
IntegerInteger = <CRemoteData>.RedialCount
Visual Basic object definitions
CRemoteData properties
22
Table 2-4
CRemoteData properties and return values (continued)
DescriptionReturn valueProperty
Returns thenumber of seconds between redial attempts
IntegerInteger = <CRemoteData>.RedialDelay
Returns the login name that is used for automatic logins
StringString = <CRemoteData>.AutoLoginName
Returns the value of the ExecuteProtection setting
BoolBool = <CRemoteData>.ExecuteProtection
Returns the value of the ReadProtection setting
BoolBool = <CRemoteData>.ReadProtection
Returns the value of the WriteProtection setting
BoolBool = <CRemoteData>.WriteProtection
Returns TRUE if session logging is enabledBoolBool = <CRemoteData>.LogSession
Returns the fully qualified path and name of the session recording file
StringString = <CRemoteData>.RecordFile
Returns the value of the session recording setting
BoolBool = <CRemoteData>.RecordSession
Connection type properties
The following table defines the connection type properties and parameters.
In Table 2-5, replace the information in angle brackets with the actual values.
23Visual Basic object definitions
CRemoteData properties
Table 2-5
Connection type properties and parameters
DescriptionParameterProperty
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)
String<CRemoteData>.ConnectionType(String)
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
Returns the connection type of the remote object.
StringString = <CRemoteData>.ConnectionTypes
Visual Basic object definitions
CRemoteData properties
24
Table 2-6
Connection type properties and return values (continued)
DescriptionReturn valueProperty
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)
IntegerInteger = <CRemoteData>.ConnectionType
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.
StringString = <CRemoteData>.NextConnectionType
Returns TRUE if the named connection type is found in the list of available connection types.
BoolBool =
<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
DescriptionParameterProperty
Sets the area code dialing properties for modem connections
String<CRemoteData>.AreaCode(String)
25Visual Basic object definitions
CRemoteData properties
Table 2-7
Properties and parameters for dialing properties (continued)
DescriptionParameterProperty
Sets the country code dialing properties for modem connections
String<CRemoteData>.CountryCode(String)
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
Returns the first available country code that is listed in the operating system.
StringString = <CRemoteData>.FirstCountryCode
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.
StringString = <CRemoteData>.NextCountryCode
COM device properties
The followingtable describes the propertiesand parameters 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.
Visual Basic object definitions
CRemoteData properties
26
Table 2-9
COM device properties and parameters
DescriptionParameterProperty
Sets the communications parity
The following values are valid:
<None>
Odd
Even
Mark
Space
String<CRemoteData>.ComParity(String)
Sets theflow control of COM-based connection types
The following values are valid:
<None>
XONXOFF
RTS/CTS
Both
String<CRemoteData>.ComFlowControl(String)
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>.ComStartedBy(String)
Sets the end 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)
String<CRemoteData>.ComEndedBy(String)
27Visual Basic object definitions
CRemoteData properties
Table 2-9
COM device properties and parameters (continued)
DescriptionParameterProperty
Contains the maximum COM speed setting
The following values are valid:
110
300
600
1200
2400
4800
9600
38400
57600
115200
Long<CRemoteData>.ComSpeed(Long)
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
Returns one of the following values for communications parity:
<None>
Odd
Even
Mark
Space
StringString = <CRemoteData>.ComParity
Returns the Com Flow setting of the remote object
The following values are valid:
<None>
XONXOFF
RTS/CTS
Both
StringString = <CRemoteData>.ComFlowControl
Visual Basic object definitions
CRemoteData properties
28
Table 2-10
COM device properties and return values (continued)
DescriptionReturn valueProperty
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
StringString = <CRemoteData>.ComStartedBy
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)
StringString = <CRemoteData>.ComEndedBy
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
LongLong = <CRemoteData>.ComSpeed
NetBIOS device properties
The following table defines the property and parameter for a NetBIOS network device.
29Visual Basic object definitions
CRemoteData properties
In Table 2-11, replace the information in angle brackets with the actual values.
Table 2-11
NetBIOS property and parameter
DescriptionParameterProperty
Sets the LAN Adapter (LANA) number for NetBIOS connections
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
DescriptionReturn valueProperty
Returns thecurrent setting of the LANAdapter (LANA) number for NetBIOS connections
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
Activates or deactivates channel bonding for ISDN CAPI devices
Bool<CRemoteData>.CapiChannelBonding(Bool)
Sets any additional CAPI extensions that are needed for communications
String<CRemoteData>.CapiExtensions(String)
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
Returns the current ISDN CAPI channel bonding setting in the remote object
BoolBool= <CRemoteData>.CapiChannelBonding
Visual Basic object definitions
CRemoteData properties
30
Table 2-14
ISDN via CAPI 2.0 properties and return values (continued)
DescriptionReturn valueProperty
Returns the current list of CAPI extensions from the remote object
StringString = <CRemoteData>.CapiExtensions
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
DescriptionParameterProperty
Sets the name of the private key container to use.
String<CRemoteData>.PrivateKey(String)
Sets the common name of the private key to use.
String<CRemoteData>.CertificateName(String)
Sets the encryption level.
The following values are valid:
-1: None
0: pcAnywhere
1: Symmetric
2: Public key
Byte<CRemoteData>.EncryptionLevel(Byte)
Defines whether the remote computer allows a connection to a host computer that uses a lower level of encryption.
Bool<CRemoteData>.DenyLowerEncrypt(Bool)
Sets the domain name for automatic logins. This optionis used with NT authenticationand Windows authentication.
String<CRemoteData>.AutoDomain(String)
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.
31Visual Basic object definitions
CRemoteDataEx object
Table 2-16
CRemoteDataEx properties and return values
DescriptionReturn valueProperty
Returns the name of the currently active private key container.
StringString = <CRemoteData>.PrivateKey
Returns the common name of the active private key container.
StringString = <CRemoteData>.CertificateName
Returns one of the following encryption settings:
-1: None
0: pcAnywhere
1: Symmetric
2: Public key
ByteByte = <CRemoteData>.EncryptionLevel
Returns thevalue of the deny lowerencryption setting.
BoolBool = <CRemoteData>.DenyLowerEncrypt
Returns the domain name setting for automatic logins. This option is used with NT authentication and Windows authentication.
StringString = <CRemoteData>.AutoDomain
Visual Basic sample code for remote functionality
The followingVisual Basic sample code retrieves a remotedata object 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)
'display and change current directory
s = RemoteDataManager.CurrentDirectory()
MsgBox ( s )
RemoteDataManager.ChangeDirectory ("C:\dev\bin.w32\data")
s = RemoteDataManager.CurrentDirectory()
MsgBox ( s )
Visual Basic object definitions
CRemoteDataEx object
32
'retrieve remote data object
Set RemoteData = RemoteDataManager.RetrieveObjectEx("pod.CHF",
2, 0)
'display some properties
s = RemoteData.AreaCode()
MsgBox (s)
s = RemoteData.PhoneNumber()
MsgBox (s)
'set some properties
RemoteData.AreaCode = "212"
RemoteData.PhoneNumber = "555-5555"
'write object to disk
RemoteData.WriteObject (0)
End Sub
Use the FindFirst and FindNext methods to display the remote file in a directory as follows:
Private Sub Command5_Click()
Dim RemoteDataManager as Object
Dim RemoteData as Object
Dim s as string
Set RemoteDataManager =
CreateObject("WINAWSVR.REMOTEDATAMANAGER")
RemoteDataManager.ChangeDirectory
("C:\dev\bin.w32\data")
RemoteDataManager.FindFirst "*", s
MsgBox (s)
RemoteDataManager.FindNext s
MsgBox (s)
End Sub
33Visual Basic object definitions
CRemoteDataEx object
Create aremote object. Set the connection typeto TCP/IP and the computer name "Host1," and then launch it as follows:
Private Sub Command6_Click()
Dim RemoteDataManager as Object
Dim RemoteData as Object
Dim s as string
Set RemoteDataManager =
CreateObject("WINAWSVR.REMOTEDATAMANAGER")
MsgBox (RemoteDataManager.CurrentDirectory())
RemoteDataManager.ChangeDirectory ("C:\dev\bin.w32\data")
MsgBox (RemoteDataManager.CurrentDirectory())
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.
DescriptionParameter or
return value
CHostDataManager method
The full path name of the current pcAnywhere data directory in which pcAnywhere host objects are stored
Return value = String
CurrentDirectory()
File name pattern to filter object files (an asterisk [*] finds all files in the current directory)
Parameter = Pattern as string
FindFirst(Pattern)
Return buffer for the full path name of the host object file that matches the specified pattern
Parameter = Name as string
FindFirst(Name string)
Visual Basic object definitions
CHostDataManager methods
34
DescriptionParameter or
return value
CHostDataManager method
TRUE if a host object file matching the specified patternis found. The full path name of the matching file is stored in Name
Return value = Boolean
FindFirst
Return buffer for the full path name of the host object file that matches the pattern specified in the original call to FindFirst()
Parameter = Name as string
FindNext(Name)
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 Name
Return value = Boolean
FindNext
The fully qualified host object file name to be loaded
Parameter = Name as string
RetrieveObject(Name)
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
Parameter = AccessMode as integer
RetrieveObject(AccessMode)
Object password. May be NULLParameter = Password as string
RetrieveObject(Password)
CHostData object from the specified fileReturn value = Object
RetrieveObject
The fully qualified host object file name to be
loaded
Parameter = Name as string
RetrieveObjectEx(Name)
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
Parameter = AccessMode as integer
RetrieveObjectEx(AccessMode)
35Visual Basic object definitions
CHostDataManager methods
DescriptionParameter or
return value
CHostDataManager method
Object password. May be NULLParameter = Password as string
RetrieveObjectEx(Password)
CHostDataEx object from the specified fileReturn value = Object
RetrieveObjectEx
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
Parameter = Name as string
CreateObject(Name)
CHostDataReturn value = Object
CreateObject
Creates a CHostDataEx object and returns an
LPDISPATCH pointer to it. The parameter is
the fully qualified host object file name for
the new object
Parameter = Name as string
CreateObjectEx(Name)
CHostDataExReturn value = Object
CreateObjectEx
The fully qualified host object file name of
the object to be deleted
Parameter = Name as string
DeleteObject(Name)
Object passwordParameter = Password as string
DeleteObject(Password)
TRUE if object is deletedReturn value = Boolean
DeleteObject
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
Parameter = Name as string
Launch(Name)
TRUE if object is successfully launchedReturn value = Boolean
Launch
CHostData properties
The following table describes the properties and parameters that are available for the CHostData object.
Visual Basic object definitions
CHostData properties
36
In Table 2-17, replace the information in angle brackets with the actual values.
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)
Sets the number of redial attempts before cancelling the call.
Integer<CHostData>.RedialCount(Integer)
Sets the number of seconds to wait between redial attempts.
Integer<CHostData>.RedialDelay(Integer)
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.
String<CHostData>.Password(String)
Sets the requirement of a password to execute the object. Set by Password.
Bool<CHostData>.ExecuteProtection(Bool)
Sets therequirement of a password to view the properties of the host object. Set by Password.
Bool<CHostData>.ReadProtection(Bool)
Sets the requirement of a password to save changes to the host object. Set by Password.
Bool<CHostData>.WriteProtection(Bool)
Activates and deactivates session logging.Bool<CHostData>.LogSession(Bool)
Sets the fully qualified path and name to the location of the file that records the active session.
String<CHostData>.RecordFile(String)
Activates and deactivates automatic session recording.
Bool<CHostData>.RecordSession(Bool)
Sets the password for the object. You can use this property to refresh the local data copy of the host object.
String<CHostData>.ReadObject(String)
Sets the password for the object. Use this property to create the host object or to write changes thatyou have made to the host object.
String<CHostData>.WriteObject(String)
37Visual Basic object definitions
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
Returns the phone number of the host computer
StringString = <CHostData>.PhoneNumber
Returns the use of the system dialing properties that are set in the host object
BoolBool = <CHostData>.UseDialingProperties
Returns the number of redial attempts that is set in the host object
IntegerInteger = <CHostData>.RedialCount
Returns thenumber of seconds between redial attempts
IntegerInteger = <CHostData>.RedialDelay
Returns the value of the ExecuteProtection setting
BoolBool = <CHostData>.ExecuteProtection
Returns the value of the ReadProtection setting
BoolBool = <CHostData>.ReadProtection
Returns the value of the Write Protection setting
BoolBool = <CHostData>.WriteProtection
Returns TRUE if session logging is enabledBoolBool = <CHostData>.LogSession
Returns the fully qualified path and name of the session recording file
StringString = <CHostData>.RecordFile
Returns the value of the session recording setting
BoolBool = <CHostData>.RecordSession
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.
Visual Basic object definitions
CHostData properties
38
Table 2-19
Connection type properties and parameters
DescriptionParameterProperty
Sets theconnection type of thehost. 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)
String<CHostData>.ConnectionType(String)
Sets the connection type that is defined in the string to active status.
String<CHostData>.AssignConnection(String)
Sets the connection type that is defined in the string to inactive status.
String<CHostData>.UnassignConnection(String)
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
Returns the connection type of the host object.
StringString = <CHostData>.ConnectionTypes
39Visual Basic object definitions
CHostData properties
Table 2-20
Connection type properties and return values (continued)
DescriptionReturn valueProperty
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)
IntegerInteger = <CHostData>.ConnectionType
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.
StringString = <CHostData>.NextConnectionType
Returns TRUE if the named connection type is found in the list of available connection types.
BoolBool =
<CHostData>.FindConnectionType(ConnectionType)
Returns the maximum number of connection types that can be active on this host.
IntegerInteger= <CHostData>.MaxAssignedConnections
Returns the first assigned active connection type.
StringString = <CHostData>.FirstAssignedConnection
Returns the next assigned active connection type.
StringString = <CHostData>.NextAssignedConnection
Returns TRUE if the connection type that is passed in matches any of the active connection types.
BoolBool =
<CHostData>.FindAssignedConnection(ConnectionType)
Visual Basic object definitions
CHostData properties
40
AssignConnection(ConnectionType) method
The AssignConnection(ConnectionType) method places the requested connection type onthe host objects list of assignedconnection types and makes it thecurrent 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 is passed 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:
DescriptionParameter
The name of a connection device type to be assignedConnectionType as
string
The following table defines the AssignConnection return value:
DescriptionReturn value
TRUE if this device type is available and the maximum allowed assigned connection count has not already been reached
Boolean
UnassignConnection(ConnectionType) method
The UnassignConnection(ConnectionType) method returns TRUE if theconnection type thatis passed in issuccessfully removed from the list of assigned connection types.
The following table defines the UnassignConnection parameter:
DescriptionParameter
The name of a connection device type to be unassignedConnectionType as
string
41Visual Basic object definitions
CHostData properties
The following table defines the UnassignConnection return value:
DescriptionReturn value
TRUE if this device type is successfully unassignedBoolean
Dialing properties
The followingtable defines the properties and returnvalues 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 area code 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
Returns the first available country code that is listed in the operating system.
StringString= <CHostData>.FirstCountryCode
Returns the next available country code. This is calledsequentially for the number ofcountry codes thatis set in <CHostData>.CountryCodes to enumerate all country codes.
StringString = <CHostData>.NextCountryCode
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.
Visual Basic object definitions
CHostData properties
42
In Table 2-23, replace the information in angle brackets with the actual values.
Table 2-23
COM device properties and parameters
DescriptionParameterProperty
Sets the communications parity
The following values are valid:
<None>
Odd
Even
Mark
Space
String<CHostData>.ComParity(String)
Sets theflow control of COM-based connection types
The following values are valid:
<None>
XONXOFF
RTS/CTS
Both
String<CHostData>.ComFlowControl(String)
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>.ComStartedBy(String)
Sets the end 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)
String<CHostData>.ComEndedBy(String)
43Visual Basic object definitions
CHostData properties
Table 2-23
COM device properties and parameters (continued)
DescriptionParameterProperty
Sets the maximum COM speed setting
The following values are valid:
110
300
600
1200
2400
4800
9600
38400
57600
115200
Long<CHostData>.ComSpeed(Long)
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
Returns one of the following values as the communications parity:
<None>
Odd
Even
Mark
Space
StringString = <CHostData>.ComParity
Returns theCom Flow setting of thehost object
The following values are valid:
<None>
XONXOFF
RTS/CTS
Both
StringString = <CHostData>.ComFlowControl
Visual Basic object definitions
CHostData properties
44
Table 2-24
COM device properties and return values (continued)
DescriptionReturn valueProperty
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
StringString = <CHostData>.ComStartedBy
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)
StringString = <CHostData>.ComEndedBy
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
LongLong = <CHostData>.ComSpeed
NetBIOS device properties
The following table defines the property and parameter for NetBIOS network devices.
45Visual Basic object definitions
CHostData properties
In Table 2-25, replace the information in angle brackets with the actual values.
Table 2-25
NetBIOS property and parameter
DescriptionParameterProperty
Sets the LAN Adapter (LANA) number for NetBIOS connections
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
DescriptionReturn valueProperty
Returns thecurrent setting of the LANAdapter (LANA) number for NetBIOS connections
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
Activates or deactivates channel bonding for ISDN CAPI devices
Bool<CHostData>.CapiChannelBonding(Bool)
Sets any additional CAPI extensions that are needed for communications
String<CHostData>.CapiExtensions(String)
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
Returns the current ISDN CAPI channel bonding setting in the host object
BoolBool= <CHostData>.CapiChannelBonding
Visual Basic object definitions
CHostData properties
46
Table 2-28
ISDN via CAPI 2.0 properties and return values (continued)
DescriptionReturn valueProperty
Returns the current list of CAPI extensions from the host object
StringString = <CHostData>.CapiExtensions
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
CHostDataEx properties and parameters
DescriptionParameterProperty
Sets the name of the private key container to use.
String<CHostData>.CryptPrivateKey(String)
Sets the common name of the private key to use.
String<CHostData>.CryptCommonName(String)
Sets the encryption level.
The following values are valid:
-1: None
0: pcAnywhere
1: Symmetric
2: Public key
Byte<CHostData>.CryptReqLevel(Byte)
Defines whether the host computer accepts connections froma remote computer that uses a lower level of encryption.
Bool<CHostData>.CryptRefuseLower(Bool)
Sets the fully qualified path to the caller files.String<CHostData>.CallersPath(String)
Defines whetherthe host user will beprompted to confirm connections.
Bool<CHostData>.ConfirmConnect(Bool)
Sets the number of secondsbefore the prompt to confirm the connection time limit expires.
Byte<CHostData>.ConfirmTimeout(Byte)
47Visual Basic object definitions
CHostDataEx object
Table 2-29
CHostDataEx properties and parameters (continued)
DescriptionParameterProperty
Defines whether the connection should be ended if the prompt to confirm the connection time limit expires.
Bool<CHostData>.ConfirmDeny(Bool)
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.
Byte<CHostData>.PwAttempts(Byte)
Sets the number of minutes that a user has to complete the logon before the connection is dropped.
Byte<CHostData>.PwTimeout(Byte)
Defines which mouse and keyboard will be active during the connection.
The following values are valid:
0: Host and remote
1: Host
2: Remote
Byte<CHostData>.ActiveKbds(Byte)
Sets the number of minutes in which the keyboard andmouse can be inactive beforethe connection is ended.
Byte<CHostData>.InactiveTimeout(Byte)
Sets the lock host computer upon startup setting.
Bool<CHostData>.LockSystemWhileWait(Bool)
Sets the run minimized host startup option.Bool<CHostData>.MinimizeOnLaunch(Bool)
Enables the host to run as a service.Bool<CHostData>.RunAsService(Bool)
Sets the number of minutes to wait before allowing another caller to connect.
Byte<CHostData>.ConnLostWait(Byte)
Defines whetherto wait for another connection or cancel the host if the session ends abnormally.
The following values are valid:
FALSE: Wait
TRUE: Cancel host
Bool<CHostData>.ConnLostHostOpts(Bool)
Visual Basic object definitions
CHostDataEx object
48
Table 2-29
CHostDataEx properties and parameters (continued)
DescriptionParameterProperty
Activates or deactivates the end of session security options for sessions that end abnormally.
Bool<CHostData>.EnableConnLostSecurity(Bool)
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>.AuthenticationType(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>.ConnLostSecurity(Byte)
Sets the number of seconds to wait before the host modem calls back the remote.
Byte<CHostData>.CallbkDelay(Byte)
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
Bool<CHostData>.EndSessHostOpts(Bool)
49Visual Basic object definitions
CHostDataEx object
Table 2-29
CHostDataEx properties and parameters (continued)
DescriptionParameterProperty
Activates or deactivates the security options for a normal end of session.
Bool<CHostData>.EnableEndSessSecurity(Bool)
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
Byte<CHostData>.EndSessSecurity(Byte)
Sets screen blanking on the host computer. Some video cards do not support this option.
Bool<CHostData>.BlankHost(Bool)
Disables the use of the mouse on the remote computer during a session.
Bool<CHostData>.AllowRemoteMouse(Bool)
Forces the computer to restart after any end of session if TRUE.
Bool<CHostData>.RebootOnDisconnect(Bool)
Logs off the user after the session ends.Bool<CHostData>.PasswordAfterDisc(Bool)
Logs failed password attempts.Bool<CHostData>.LogFailures(Bool)
Enables drive security options. This setting is valid only on NTFS file systems.
Bool<CHostData>.AllowDriveSecurity(Bool)
Enables the use of directory services for authentication.
Bool<CHostData>.UseDirectoryServices(Bool)
Sets the directory services settings.String<CHostData>.DirectoryServiceEntry(String)
The followingtable describes the propertiesand return values forthe 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
Returns the currently active private key container.
StringString = <CHostDataEx>.CryptPrivateKey
Returns the common name of the active private key container.
StringString = <CHostDataEx>.CryptCommonName
Visual Basic object definitions
CHostDataEx object
50
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
Returns one of the following encryption settings:
-1: None
0: pcAnywhere
1: Symmetric
2: Public key
ByteByte = <CHostDataEx>.CryptReqLevel
Returns thevalue of the deny lowerencryption setting.
BoolBool = <CHostDataEx>.CryptRefuseLower
Returns the currently active path to the caller files.
StringString = <CHostDataEx>.CallersPath
Returns the value of the confirm connection setting.
BoolBool = <CHostDataEx>.ConfirmConnect
Returns thevalue of the deny lowerencryption setting.
ByteByte = <CHostDataEx>.ConfirmTimeout
Returns the value of the disconnect if timeout setting.
BoolBool = <CHostDataEx>.ConfirmDeny
Returns the value of the make passwords case sensitive setting.
BoolBool = <CHostDataEx>.PwCaseSensitive
Returns the value of the limit login attempts per call setting.
ByteByte = <CHostDataEx>.PwAttempts
Returns thevalue of the limittime to complete login setting (in minutes).
ByteByte = <CHostDataEx>.PwTimeout
Returns the active keyboard and mouse settings.
The following values are valid:
0: Host and remote
1: Host
2: Remote
ByteByte = <CHostDataEx>.ActiveKbds
Returns the number of minutes to wait before disconnecting if the inactivity time limit expires.
ByteByte = <CHostDataEx>. InactiveTimeout
Returns the lock host computer upon startup setting.
BoolBool = <CHostDataEx>.LockSystemWhileWait
51Visual Basic object definitions
CHostDataEx object
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
Returns the run minimized on host startup setting.
BoolBool = <CHostDataEx>.MinimizeOnLaunch
Returns the run host as a service setting.BoolBool = <CHostDataEx>.RunAsService
Returns the number of minutes to wait before allowing another connection.
ByteByte = <CHostDataEx>.ConnLostWait
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
BoolBool = <CHostDataEx>.ConnLostHostOpts
Returns the value of the security option that is setfor handlingan abnormal end of session.
BoolBool = <CHostDataEx>.ConnLostWait
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).
ByteByte = <CHostDataEx>.AuthenticationType
Visual Basic object definitions
CHostDataEx object
52
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
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
ByteByte = <CHostDataEx>.ConnLostSecurity
Returns the number of seconds to wait before the host modem calls back the remote.
ByteByte = <CHostDataEx>.CallbkDelay
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
BoolBool = <CHostDataEx>.EndSessHostOpts
Returns whether the end of session security options are enabled for a normal end of session.
BoolBool = <CHostDataEx>.EnableEndSessSecurity
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
ByteByte = <CHostDataEx>.EndSessSecurity
Returns thescreen blanking option thatis set.BoolBool = <CHostDataEx>.BlankHost
Returns whetherthe remote user has keyboard and mouse control during a session.
BoolBool = <CHostDataEx>.AllowRemoteMouse
Returns whether the host computer is restarted after the session ends.
BoolBool = <CHostDataEx>.RebootOnDisconnect
Returns whether the host user is logged off after the session ends.
BoolBool = <CHostDataEx>.PasswordAfterDisc
Returns whether the log password failures option is set.
BoolBool = <CHostDataEx>.LogFailures
53Visual Basic object definitions
CHostDataEx object
Table 2-30
CHostDataEx properties and return values (continued)
DescriptionReturn valueProperty
Returns whether the drive security option is enabled.
BoolBool = <CHostDataEx>.AllowDriveSecurity
Returns whether the directoryservices option is enabled.
BoolBool = <CHostDataEx>.UseDirectoryServices
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)
'display and change current directory
s = HostDataManager.CurrentDirectory()
MsgBox ( s )
HostDataManager.ChangeDirectory ("C:\dev\bin.w32\data")
s = HostDataManager.CurrentDirectory()
MsgBox ( s )
'retrieve remote data object
Set HostData = HostDataManager.RetrieveObject("pod.BHF", 2, 0)
'display some properties
s = HostData.AreaCode()
MsgBox (s)
s = HostData.PhoneNumber()
MsgBox (s)
'set some properties
Visual Basic object definitions
CHostDataEx object
54
RemoteData. HostData = "212"
RemoteData. HostData = "555-5555"
'write object to disk
HostData.WriteObject (0)
End Sub
Use the FindFirst and FindNext methods to display the host file in a directory as follows:
Private Sub Command5_Click()
Dim HostDataManager as Object
Dim HostData as Object
Dim s as string
Set HostDataManager = CreateObject("WINAWSVR.BEHOSTDATAMANAGER")
HostDataManager.ChangeDirectory ("C:\dev\bin.w32\data")
HostDataManager.FindFirst "*", s
MsgBox (s)
HostDataManager.FindNext s
MsgBox (s)
End Sub
Awrem32 functions
The Awrem32 functions provide the parameters and return values for handling connections between the host and remote computers.
DescriptionParameter or
return value
Awrem32 function
The fully qualified .chf file name that contains information about the host computer
Parameter = Name as string
awConnect(FileName)
TRUE if command executedReturn value =
Boolean
awConnect
55Visual Basic object definitions
Awrem32 functions
DescriptionParameter or
return value
Awrem32 function
After calling this function, the calling program must delete the object (C++ ­delete IAwrem32X*, VB - set ObjectName = Nothing;)
Return value = Boolean
awDisconnect()
Contains the fully qualified path and file name tobe copied from the hostcomputer
Parameter = HostFile as string
FileXferFromHost(HostFile)
Contains the fully qualified destination path and file name. The HostFile and RemoteFile strings do not have to be identical
Parameter = RemoteFile as string
FileXferFromHost(RemoteFile)
TRUE if command executedReturn value =
Boolean
FileXferFromHost
Copies a file from the remote computer to the host computer. The parameters can contain wildcard characters
The parametercontains the fully qualified destination path and file name
Parameter = HostFile as string
FileXferToHost(HostFile)
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
Parameter = RemoteFile as string
FileXferToHost(RemoteFile)
Contains the drive and path to create the folder on the host computer
Parmeter = FolderName as string
CreateFolderOnHost(FolderName)
TRUE if command executedReturn value =
Boolean
CreateFolderOnHost
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
Parameter = FileName as string
ExecuteHostFile(FileName)
Visual Basic object definitions
Awrem32 functions
56
DescriptionParameter or
return value
Awrem32 function
TRUE if command executedReturn value =
Boolean
ExecuteHostFile
Returns the last error generated in Awrem32
Return value = String
GetError()
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
Return value = Short
ConnectionStatus()
57Visual Basic object definitions
Awrem32 functions
Visual Basic object definitions
Awrem32 functions
58
Visual C++ object definitions
This chapter includes the following topics:
About Visual C++ objects
CRemoteDataManager methods
CRemoteData object
CRemoteDataEx object
CHostDataManager methods
CHostData object
CHostDataEx object
Awrem32 functions
About Visual C++ objects
The pcAnywhereAutomation Server provides the followingcomponents to support OLE Automation:
Provides the information needed to connect to the pcAnywhere Automation Server and access its interfaces
Winawsvr
Provides the information needed to control pcAnywhere connections
Awrem32
The objects that are described in Table 3-1 comprise Winawsvr.
3
Chapter
Table 3-1
Winawsvr objects
ReferenceDescriptionObject
See “CRemoteDataManager methods” on page 60.
Provides themethods for creating, opening, modifying, saving, and deleting CRemoteData objects
CRemoteDataManager
See “CRemoteData object” on page 63.
See “CRemoteDataEx object” on page 70.
Defines the parameters for accessing and controlling pcAnywhere remote functionality
CRemoteData
See “CHostDataManager methods” on page 71.
Provides themethods for creating, opening, modifying, saving,and deleting CHostData objects
CHostDataManager
See “CRemoteData object” on page 63.
See “CRemoteDataEx object” on page 70.
Defines the parameters for accessing and controlling pcAnywherehost functionality
CHostData
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 definitionsare provided for use with earlier versions.
For functionsthat require passwords, password values can beset but not retrieved. This is for security purposes.
CRemoteDataManager methods
The CRemoteDataManager methods provide the parameters and return values for accessing and controlling CRemoteData objects.
DescriptionParameter or
return value
Method
The full path name of the current pcAnywhere data directory in which pcAnywhere remote objects are stored
Parameter = BSTR
BSTR CurrentDirectory();
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
Parameter = LPCTSTR lpszNewDirectory
Return value = BOOL
BOOL ChangeDirectory(LPCTSTR lpszNewDirectory);
Visual C++ object definitions
CRemoteDataManager methods
60
DescriptionParameter or
return value
Method
File name pattern to filterobject files (an asterisk [*] finds all files in the current directory)
Parameter = LPCTSTR lpszPattern
BOOL FindFirst(LPCTSTR lpszPattern, BSTR FAR*);
Return buffer for the full path name of the remote object file that matches the specified pattern
Parameter = BSTR FAR * pbstrFullQualName
BOOL FindFirst(pbstrFullQualName);
TRUE if a remote object file matching the specified pattern is found. The full path name of the matching file is stored in pbstrFullQualName
Return value = BOOL
BOOL FindFirst
After FindFirst() has been successfully called toget the name ofa remote 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
Parameter = BSTR FAR * pbstrFullQualName
Return value = BOOL
BOOL FindNext(BSTR FAR* pbstrFullQualName);
Retrieves a CRemoteData object by file name
Parameter is the fully qualified remote object file name to be loaded
Parameter = LPCTSTR lpszFQName
LPDISPATCH RetrieveObject(LPCTSTR lpszFQName);
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
Parameter = short wAccessMode
LPDISPATCH RetrieveObject(short wAccessMode);
Object password. May be NULLParameter = LPCTSTR lpszPassword
LPDISPATCH RetrieveObject(LPCTSTR lpszPassword);
61Visual C++ object definitions
CRemoteDataManager methods
DescriptionParameter or
return value
Method
Retrieves a CRemoteDataEx object by file name
Parameter is the fully qualified remote object file name to be loaded
Parameter = LPCTSTR lpszFQName
LPDISPATCH RetrieveObjectEx(LPCTSTR lpszFQName);
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
Parameter = short wAccessMode
LPDISPATCH RetrieveObjectEx(short wAccessMode);
Object password. May be NULLParameter = LPCTSTR lpszPassword
LPDISPATCH RetrieveObjectEx(LPCTSTR lpszPassword);
Pointer to an OLE dispatch object. The
object is a CRemoteDataEx object.
See Visual C++ sample code for remote
functionality.
Return value = LPDISPATCH
LPDISPATCH RetrieveObjectEx
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.
Parameter = LPCTSTR lpszFQName
Return value = LPDISPATCH
LPDISPATCH CreateObject(LPCTSTR lpszFQName);
Visual C++ object definitions
CRemoteDataManager methods
62
DescriptionParameter or
return value
Method
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.
Parameter = LPCTSTR lpszFQName
Return value = LPDISPATCH
LPDISPATCH CreateObjectEx(LPCTSTR lpszFQName);
Deletes a remote object file.
Parameter is the fully qualified remote object file name of the object to be deleted
Parameter = LPCTSTR lpszFQName
BOOL DeleteObject(LPCTSTR lpszFQName);
Object password. May be NULLParameter = LPCTSTR lpszPassword
BOOL DeleteObject(LPCTSTR lpszPassword);
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
Parameter = LPCTSTR lpszFQName
Return value = BOOL
BOOL Launch(LPCTSTR lpszFQName);
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.
63Visual C++ object definitions
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 dialing properties are to be used, this is the area code of the number 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 sent to 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);
Visual C++ object definitions
CRemoteData object
64
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);
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
65Visual C++ object definitions
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>
Visual C++ object definitions
CRemoteData object
66
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
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
67Visual C++ object definitions
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):
DescriptionParameter or
return value
Method
The number of connection types available on this computer
Return value = Short
short ConnectionTypes();
Visual C++ object definitions
CRemoteData object
68
DescriptionParameter or
return value
Method
FirstConnectionType() and
NextConnectionType() areused to iterate
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
Return value = BSTR
BSTR FirstConnectionType(); and BSTR NextConnectionType();
The name of a connection device type
The return value is TRUE if the
connection type that is passed in exists
on the computer
Parameter = LPCTSTR lpszConnectionTyp
Return value = BOOL
BOOL FindConnectionType(LPCTSTR lpszConnectionType);
Returns the number of country codes
available
Return value = Short
short CountryCodes();
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
Return value = BSTR
BSTR FirstCountryCode(); and BSTR NextCountryCode();
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
Parameter = LPCTSTR lpszPassword
Return value = BOOL
BOOL ReadObject(LPCTSTR lpszPassword);
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
Parameter = LPCTSTR lpszPassword
Return value = BOOL
BOOL WriteObject(LPCTSTR lpszPassword);
69Visual C++ object definitions
CRemoteData 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:
BOOL LaunchTCPRemote(LPCTSTR lpszAddress)
{
BOOL bReturn = FALSE;
CRemoteDataManager remoteDM;
CRemoteData remoteData;
// First, create the CRemoteDataManager
remoteDM.CreateDispatch( _T( "WINAWSVR.RemoteDataManager") );
// Next, create CRemoteData and attach it
remoteData.AttachDispatch( remoteDM.CreateObject("Test", 0) );
// Now, set the required properties
remoteData.SetConnectionType("TCP/IP");
remoteData.SetComputerName(lpszAddress);
Visual C++ object definitions
CRemoteDataEx object
70
// Save the object data
if (remoteData.WriteObject(0))
{
// And launch it
if (remoteData.Launch())
bReturn = TRUE;
}
// Release the remote object.
remoteData.ReleaseDispatch();
remoteDM.ReleaseDispatch( _T( "WINAWSVR.RemoteDataManager") );
return bReturn;
}
CHostDataManager methods
The following table describes the CHostDataManager methods, including the parameters and return values for accessing and controlling CHostData objects:
DescriptionParameter or
return value
Method
Returns the full path name of the current directoryin which pcAnywhere host objects are stored
Return value= BSTRBSTR CurrentDirectory();
Changes the current directory in which pcAnywhere host objects are stored
The parameter is name of an existing directory
The return value is TRUE if successful
Parameter = LPCTSTR lpszNewDirectory
Return value = BOOL
BOOL ChangeDirectory(LPCTSTR lpszNewDirectory);
71Visual C++ object definitions
CHostDataManager methods
DescriptionParameter or
return value
Method
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 a host object file matching the specified pattern is found. The full path name of the matching file is stored in pbstrFullQualName
Parameter = LPCTSTR lpszPattern
Return value = BOOL
BOOL FindFirst(LPCTSTR lpszPattern);
Return buffer for the full path name of the remote object file that matches the specified pattern
The returnvalue is TRUE if a host object file matching the specified pattern is found. The full path name of the matching file is stored in pbstrFullQualName.
Parameter = BSTR FAR * pbstrFullQualName
BOOL FindFirst(BSTR FAR* 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 full pathname ofthe hostobject file 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
Parameter = BSTR FAR * pbstrFullQualName
Return value = BOOL
BOOL FindNext(BSTR FAR* pbstrFullQualName);
Retrieves a CHostData object by file name.
The parameteris the fully qualified host object file name to be loaded
Parameter = LPCTSTR lpszFQName
LPDISPATCH RetrieveObject(LPCTSTR lpszFQName);
Visual C++ object definitions
CHostDataManager methods
72
DescriptionParameter or
return value
Method
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
Parameter = short wAccessMode
LPDISPATCH RetrieveObject(short wAccessMode);
Object password. May be NULLParameter = LPCTSTR lpszPassword
LPDISPATCH RetrieveObject(LPCTSTR lpszPassword);
Pointer to an OLE dispatch object. The
object is a CHostData object.
See Visual C++ sample code for host
functionality.
Return value = LPDISPATCH
LPDISPATCH RetrieveObject
Retrieves a CHostDataEx object by file
name
The parameteris the fully qualified host
object file name to be loaded
Parameter = LPCTSTR lpszFQName
LPDISPATCH RetrieveObjectEx(LPCTSTR lpszFQName);
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
Parameter = short wAccessMode
LPDISPATCH RetrieveObjectEx(short wAccessMode);
Object password. May be NULLParameter = LPCTSTR lpszPassword
LPDISPATCH RetrieveObjectEx(LPCTSTR lpszPassword);
Pointer to an OLE dispatch object. The
object is a CHostDataEx object
See Visual C++ sample code for host
functionality.
Return value = LPDISPATCH
LPDISPATCH RetrieveObjectEx
73Visual C++ object definitions
CHostDataManager methods
DescriptionParameter or
return value
Method
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.
Parameter = LPCTSTR lpszFQName
Return value = LPDISPATCH
LPDISPATCH CreateObject(LPCTSTR lpszName);
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.
Parameter = LPCTSTR lpszFQName
Return value = LPDISPATCH
LPDISPATCH CreateObjectEx(LPCTSTR lpszName);
Deletes a host object file
The parameteris the fully qualified host object file name of the object to be deleted
Parameter = LPCTSTR lpszFQName
BOOL DeleteObject(LPCTSTR lpszFQName);
Object password. May be NULLParameter = LPCTSTR lpszPassword
BOOL DeleteObject(LPCTSTR lpszPassword);
TRUE if object is deletedReturn value = BOOL
BOOL DeleteObject
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
Parameter = LPCTSTR lpszFQName
Return value = BOOL
BOOL Launch(LPCTSTR lpszFQName);
Visual C++ object definitions
CHostDataManager methods
74
CHostData object
Use this object to modify host object data.
Get and Set methods
The following methods are used to get andset 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 dialing properties are to be used, this is the area code of the number 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);
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.
75Visual C++ object definitions
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 objects 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 is passed 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
Visual C++ object definitions
CHostData object
76
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() and NextConnectionType()to search for available 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);
The following code sets the communications parity levels:
BSTR GetComParity();
void SetComParity(LPCTSTR lpszNewValue);
Communication parity values are as follows:
None
Odd
Even
Mark
Space
The following code sets the flow control levels:
BSTR GetComFlowControl();void SetComFlowControl(LPCTSTR
lpszNewValue);
Flow control values are as follows:
<None>
XONXOFF
RTS/CTS
77Visual C++ object definitions
CHostData object
BOTH
The following code sets the connection start values:
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
The following code 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)
The following code sets the connection speed:
long GetComSpeed();
void SetComSpeed(long nNewValue);
Connection speed values are as follows:
110
300
600
1200
2400
Visual C++ object definitions
CHostData object
78
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);
NASI/NCSI device details
Sets the user name for the NASI server.
BSTR GetNasiUserName();
void SetNasiUserName(LPCTSTR lpszNewValue);
Sets the user password for NASI server.
BSTR GetNasiPassword();
void SetNasiPassword(LPCTSTR lpszNewValue);
Sets the NASI session name.
BSTR GetNasiSessionName();
void SetNasiSessionName(LPCTSTR lpszNewValue);
BOOL GetNasiSessionNameAvailable();
void SetNasiSessionNameAvailable(BOOL bNewValue);
Specifies the NASI server to use.
BOOL NasiServer();
BSTR GetNasiServerName();
void SetNasiServerName(LPCTSTR lpszNewValue);
Specifies the NASI Service to use.
BOOL NasiService();
BSTR GetNasiServiceName();
void SetNasiServiceName(LPCTSTR lpszNewValue);
Specifies the NASI Port to use.
79Visual C++ object definitions
CHostData object
BOOL NasiPort();
BSTR GetNasiPortName();
void SetNasiPortName(LPCTSTR lpszNewValue);
BOOL GetNasiSelectOnConnect();
void SetNasiSelectOnConnect(BOOL bNewValue);
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);
Host object methods
The following table describes the normal methods of the object (they are not used to get and set properties):
DescriptionParameter or
return value
Method
Returns the number of connection types available on this computer
Return value = Short
short ConnectionTypes();
FirstConnectionType() and NextConnectionType() are used to iterate through the available connection types. The functions return a BSTR, which is the 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
Return value = BSTR
BSTR FirstConnectionType(); and BSTR NextConnectionType();
The parameter is the name of a connection device type
The return value is TRUE if this device type is available
Parameter = LPCTSTR lpszConnectionTyp
Return value = BOOL
BOOL FindConnectionType(LPCTSTR lpszConnectionType);
Visual C++ object definitions
CHostData object
80
DescriptionParameter or
return value
Method
Returns the maximum number of connection types that can be assigned at the same time (currently two)
Return value = Short
short MaxAssignedConnections()
Returns the number of assigned connection types.
Return value = Short
short AssignedConnections()
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
Return value = BSTR
BSTR FirstAssignedConnection(); and BSTR NextAssignedConnection();
The parameter is the name of a connection device type
The return value is TRUE if this device type is currently assigned
Parameter = LPCTSTR lpszConnectionTyp
Return value = BOOL
BOOL FindAssignedConnection (LPCTSTR lpszConnectionType);
Returns the number of country codes available
Return value = Short
short CountryCodes();
FirstCountryCode() and NextCountryCode() are used to iterate through the list of available country codes. Thefunctions 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
Return value = BSTR
BSTR FirstCountryCode(); and BSTR NextCountryCode();
Reads theobject data from thehost object file
The parameter is the object password
The return value is TRUE if object is successfully read
Parameter = LPCTSTR lpszPassword
Return value = BOOL
BOOL ReadObject(LPCTSTR lpszPassword);
81Visual C++ object definitions
CHostData object
DescriptionParameter or
return value
Method
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
Parameter = LPCTSTR lpszPassword
Return value = BOOL
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:
BOOL GetReadProtection();
void SetReadProtection(BOOL bNewValue);
BOOL GetWriteProtection();
void SetWriteProtection(BOOL bNewValue);
BSTR GetPassword(); //Returns "NOT IMPLEMENTED"
void SetPassword(LPCTSTR lpszNewValue);
BSTR GetCallersPath();
void SetCallersPath(LPCTSTR lpszNewValue);
BOOL GetConfirmConnect();
void SetConfirmConnect(BOOL bNewValue);
short GetConfirmTimeout();
void SetConfirmTimeout(short nNewValue);
BOOL GetConfirmDeny();
void SetConfirmDeny(BOOL bNewValue);
BOOL GetPwCaseSensitive();
void SetPwCaseSensitive(BOOL bNewValue);
short GetPwAttempts();
void SetPwAttempts(short nNewValue);
short GetPwTimeout();
void SetPwTimeout(short nNewValue);
short GetActiveKbds();
void SetActiveKbds(short nNewValue); //Sets ActiveKbds
short GetInactiveTimeout();
void SetInactiveTimeout(short nNewValue);
short GetCryptReqLevel();
void SetCryptReqLevel(short nNewValue);
BOOL GetCryptRefuseLower();
void SetCryptRefuseLower(BOOL bNewValue);
Visual C++ object definitions
CHostDataEx object
82
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);
83Visual C++ object definitions
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:
BOOL LaunchTCPHost(LPCTSTR lpszAddress)
{
BOOL bReturn = FALSE;
CHostDataManager hostDM;
CHostData hostData;
// First, create the CHostDataManager
hostDM.CreateDispatch( _T( "WINAWSVR.BeHostDataManager") );
// Next, create CRemoteData and attach it
hostData.AttachDispatch(hostDM.CreateObject("Test", 0) );
// Now, set the required properties
hostData.SetConnectionType("TCP/IP");
// Save the object data
if (hostData.WriteObject(0))
{
// And launch it
if (hostData.Launch())
bReturn = TRUE;
}
// Release the Host object.
hostData.ReleaseDispatch();
return (bReturn);
}
Visual C++ object definitions
CHostDataEx object
84
Awrem32 functions
The following table describes the Awrem32 functions, including the parameters and return values for handling connections between a host and remote computer:
DescriptionParameter or
return value
Method
Creates the connection to the host computer
The parameter is the fully qualified .chf file name that contains information about the host computer
The returnvalue executes the command
Parameter =Name as string
Return value = Boolean
boolean awConnect(BSTR FileName);
Disconnects the host computer
After calling this function, the calling program must delete the object (C++ ­delete IAwrem32X*, VB – set ObjectName = Nothing;)
Return value = Boolean
boolean awDisconnect();
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
Parameter = HostFile as string
boolean FileXferFromHost(BSTR HostFile);
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.
Parameter = RemoteFile as string
boolean FileXferFromHost(BSTR RemoteFile);
TRUE if command executedReturn value =
Boolean
boolean FileXferFromHost
85Visual C++ object definitions
Awrem32 functions
DescriptionParameter or
return value
Method
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
Parameter = HostFile as string
boolean FileXferToHost(BSTR HostFile);
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
Parameter = RemoteFile as string
boolean FileXferToHost(BSTR RemoteFile);
TRUE if command executedReturn value =
Boolean
boolean FileXferToHost
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
Parameter = FolderName as string
Return value = Boolean
boolean CreateFolderOnHost(BSTR FolderName);
Visual C++ object definitions
Awrem32 functions
86
DescriptionParameter or
return value
Method
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
Parameter =FileName as string
Return value = Boolean
boolean ExecuteHostFile(BSTR FileName);
Returns the last error generated in Awrem32 as a string
Return value = String
BSTR GetError();
Returns the current status of your connection to the host computer
The possible values include the following:
-1 = Lost connection
0 = No connection
1 = Session connected
Return value = Short
short ConnectionStatus();
87Visual C++ object definitions
Awrem32 functions
Visual C++ object definitions
Awrem32 functions
88
A
API libraries 13 automation controllers
about Visual Basic 12 about Visual C++ 13
automation server.. See pcAnywhere Automation
Server
Awrem32
functions 55, 85
C
C++.. See Visual C++ CAPI connections
host properties 46, 80 remote properties 30, 68
CHostData
using Visual Basic 36 using Visual C++ 75
CHostDataEx
using Visual Basic 47 using Visual C++ 82
CHostDataManager
using Visual Basic 34 using Visual C++ 71
class definitions
importing 14 viewing 14
code samples
Visual Basic 32, 54 Visual C++ 70, 84
COM devices
host device details 42, 76 remote device details 26, 66
connection types
assigning 41 host properties 38, 76, 80 remote properties 23, 66, 68 unassigning 41
connections
ending 56, 85 returning errors 87
connections (continued)
returning status 57, 87 starting 36, 55, 63, 85
country codes
on host 81 on remote 69
CRemoteData
using Visual Basic 21 using Visual C++ 63
CRemoteDataEx
using Visual Basic 31 using Visual C++ 70
CRemoteDataManager
using Visual Basic 18 using Visual C++ 60
D
devices.. See connection types
E
encryption settings
on host 47, 82 on remote 31–32, 70
errors
returning 57, 87
F
file transfer
from host 56, 85 to host 56, 86
files
running on host 56, 87 flow control 27, 43, 66, 77 folders
creating on host 56, 86
G
GUIDs 11
Index
H
host objects
creating 74 deleting 36, 74 device details 76 dialing properties 42 directories 34, 71 finding 35–36, 72–73 methods 80 passwords 81 starting 36, 74
I
identifiers. See GUIDs ISDN
CAPI connections
host properties 46, 80 remote properties 30, 68
M
modem connections
on host
COM properties 42, 76 country codes 81 dialing properties 42 TAPI devices 77
on remote
COM properties 26, 66 country codes 69 dialing properties 25 TAPI devices 66
N
NASI devices 79 NCSI devices 79 NetBIOS connections
host properties 45, 79 remote properties 29, 68
network connections
on host
NetBIOS properties 45, 79
on remote
NetBIOS properties 29, 68
O
OLE Automation.. See pcAnywhere Automation
Server
P
parity 27, 43, 66, 77 passwords
on host objects 81 on remote objects 69
pcAnywhere Automation Server
about 10 accessing with Visual Basic 12 accessing with Visual C++ 13 example uses 10 registering GUIDs 11 type libraries 13
R
remote engine
automatically registering 11 manually registering 12
remote objects
creating 62 deleting 63 device details 66 dialing properties 25 directories 18, 60 files 19–20, 34, 61–62 methods 68 passwords 69
S
status
returning 57, 87
T
TAPI devices
on host 77 on remote 66
type libraries 13
V
Visual Basic
accessing pcAnywhere Automation Server 12 Awrem32 functions 55 CHostData object 36 CHostDataEx object 47 CHostDataManager object 34 code samples 32, 54 CRemoteData object 21 CRemoteDataEx object 31
Index90
Visual Basic (continued)
CRemoteDataManager object 18
Visual C++
accessing pcAnywhere Automation Server 13 Awrem32 functions 85 CHostData object 75 CHostDataEx object 82 CHostDataManager object 71 code samples 70, 84 CRemoteData object 63 CRemoteDataEx object 70 CRemoteDataManager object 60 importing classes 14 including Winawsvr.h 15
W
Winawsvr
executable 12 header file 15 objects
CHostData 36, 75 CHostDataEx 47, 82 CHostDataManager 34, 71 CRemoteData 21, 63 CRemoteDataEx 31, 70 CRemoteDataManager 18, 60
91Index
Loading...