Symantec pcAnywhere™ OLE Automation Guide
Symantec pcAnywhere™ OLE Automation Guide The software described in this book is furnished under a license agreement and may be used only in accordance with the terms of the agreement. Documentation version 12.0 Legal Notice Copyright © 2006 Symantec Corporation. All rights reserved. Federal acquisitions: Commercial Software - Government Users Subject to Standard License Terms and Conditions.
Technical Support Symantec Technical Support maintains support centers globally. Technical Support’s primary role is to respond to specific queries about product feature and function, installation, and configuration. The Technical Support group also authors content for 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.
When you contact Technical Support, please have the following information available: ■ Product release level ■ Hardware information ■ Available memory, disk space, 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 registrat
■ 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: ■ Asia-Pacific and Japan: contractsadmin@symantec.com ■ Europe, Middle-East, and Africa: semea@symantec.com ■ North America and Latin America: supportsolutions@symantec.
Contents Chapter 1 Using OLE Automation with Symantec pcAnywhere About OLE Automation ....................................................................................... 11 About the pcAnywhere Automation Server .................................................... 12 What you can do with the pcAnywhere Automation Server ........................ 12 Before you start ....................................................................................................
Contents CHostDataManager methods ............................................................................. 39 CurrentDirectory() ....................................................................................... 39 FindFirst(Pattern, Name string) ................................................................ 39 FindNext(Name) ........................................................................................... 40 RetrieveObject(Name, AccessMode, Password) ...............................
Contents Chapter 3 Visual C++ object definitions About Visual C++ objects .................................................................................... 69 CRemoteDataManager methods ........................................................................ 71 BSTR CurrentDirectory(); ........................................................................... 71 BOOL ChangeDirectory(LPCTSTR lpszNewDirectory); .........................
Contents CHostDataEx object ........................................................................................... 101 Visual C++ sample code for host functionality ..................................... 103 Awrem32 functions ........................................................................................... 104 boolean awConnect(BSTR FileName); .................................................... 104 boolean awDisconnect(); ...................................................................
Chapter 1 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.
Using OLE Automation with Symantec pcAnywhere About the pcAnywhere Automation Server ■ OLE Automation controller: An application or development tool that accesses and controls the components that have been exposed by the OLE Automation server You can use any programming language that supports OLE Automation. The two most common programming languages are Microsoft Visual Basic and Microsoft Visual C++.
Using OLE Automation with Symantec pcAnywhere Before you start This document contains several examples, written in both Visual Basic and Visual C++, to illustrate how to connect to and use the pcAnywhere Automation Server. See “Visual Basic object definitions” on page 19. See “Visual C++ object definitions” on page 69.
Using OLE Automation with Symantec pcAnywhere Before you start 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 pcAnywhere Automation Server executable file (Winawsvr.exe). You only need to run the executable file once to add the GUIDs to the registry. The Winawsvr.exe file is located in the default Symantec pcAnywhere data directory.
Using OLE Automation with Symantec pcAnywhere Before you start 4 ■ Enumerate the associated data object files in the current directory. ■ Create, retrieve, or delete a data object file. 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 property’s name to differentiate between getting and setting its value.
Using OLE Automation with Symantec pcAnywhere Before you start Importing and viewing classes The pcAnywhere Automation Server uses the following type libraries: ■ Winawsvr.tlb: Provides the information needed to connect to the pcAnywhere Automation Server and access its interfaces ■ Awrem32.
Using OLE Automation with Symantec pcAnywhere Where to find more information 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 ■ Awrem32.h ■ Awrem32.cpp These files contain the class definitions and implementation source code for the pcAnywhere Automation Server.
Using OLE Automation with Symantec pcAnywhere Where to find more information
Chapter 2 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 pcAnywhere Automation Server provides the following components to support OLE Automation: ■ Winawsvr: Provides the information needed to connect to the pcAnywhere Automation Serve
Visual Basic object definitions CRemoteDataManager methods Table 2-1 describes the objects that comprise Winawsvr. Table 2-1 Winawsvr objects Object Description Reference CRemoteDataManager Provides the methods for creating, opening, modifying, saving, and deleting CRemoteData objects See “CRemoteDataManager methods” on page 20. CRemoteData Defines the parameters for accessing and controlling pcAnywhere remote functionality See “CRemoteData properties” on page 26.
Visual Basic object definitions CRemoteDataManager methods Table 2-2 defines the CurrentDirectory() return value. Table 2-2 CurrentDirectory() return value Return value Description String The full path name of the current pcAnywhere data directory ChangeDirectory(NewDirectory) Changes the current directory in which pcAnywhere remote objects are stored. Table 2-3 defines the ChangeDirectory parameter.
Visual Basic object definitions CRemoteDataManager methods Table 2-6 defines the FindFirst return value. Table 2-6 FindFirst return value Return value Description Boolean TRUE if a remote object file that matches the specified pattern is found. The full path name of the matching file is stored in Name.
Visual Basic object definitions CRemoteDataManager methods RetrieveObject(Name, AccessMode, Password) Retrieves a CRemoteData object by file name. Table 2-9 defines the RetrieveObject parameters. Table 2-9 RetrieveObject parameters Parameter Description Name as string The fully qualified remote object file name to be loaded. AccessMode as integer Specifies how this object is to be used. This relates to the password protection.
Visual Basic object definitions CRemoteDataManager methods Table 2-12 defines the RetrieveObjectEx return value. Table 2-12 RetrieveObjectEx return value Return value Description Object CRemoteDataEx object from the specified file CreateObject(Name) Creates a CRemoteData object and returns an LPDISPATCH pointer to it. Table 2-13 defines the CreateObject parameter.
Visual Basic object definitions CRemoteDataManager methods DeleteObject(Name, Password) Deletes a remote object file. Table 2-17 defines the DeleteObject parameters. Table 2-17 DeleteObject parameters Parameter Description Name as string The fully qualified remote object file name of the object to be deleted Password as string Object password Table 2-18 defines the DeleteObject return value.
Visual Basic object definitions CRemoteData properties CRemoteData properties Table 2-19 defines the properties and parameters that are available for the CRemoteData object. Replace the information in angle brackets with the actual values. Table 2-19 CRemoteData properties and parameters Property Parameter Description .ComputerName(String) String Sets the computer name or IP address of the host computer. .
Visual Basic object definitions CRemoteData properties Table 2-19 CRemoteData properties and parameters Property Parameter Description .RecordFile(String) String Sets the fully qualified path and name to the location of the file that records the active session. .RecordSession(Bool) Bool Activates and deactivates automatic session recording. .ReadObject(String) String Sets the password of the object.
Visual Basic object definitions CRemoteData properties Table 2-20 CRemoteData properties and return values Property Return value Description Bool = .RecordSession Bool Returns the value of the session recording setting Connection type properties Table 2-21 defines the connection type properties and parameters. Replace the information in angle brackets with the actual values. Table 2-21 Connection type properties and parameters Property Parameter Description .
Visual Basic object definitions CRemoteData properties Table 2-22 defines the connection type properties and return values. Replace the information in angle brackets with the actual values. Table 2-22 Connection type properties and return values Property Return value Description String = .ConnectionTypes String Returns the connection type of the remote object. Integer = .ConnectionType Integer Returns the number of available connection types.
Visual Basic object definitions CRemoteData properties Dialing properties Table 2-23 defines the properties and parameters for setting the dialing properties for modem connections. Replace the information in angle brackets with the actual values. Table 2-23 Properties and parameters for dialing properties Property Parameter Description .AreaCode(String) String Sets the area code dialing properties for modem connections .
Visual Basic object definitions CRemoteData properties COM device properties Table 2-25 describes the properties and parameters that let you customize the port settings for modem and other COM-based connections. Replace the information in angle brackets with the actual values. Table 2-25 COM device properties and parameters Property Parameter Description .ComParity(String) String Sets the communications parity The following values are valid: .
Visual Basic object definitions CRemoteData properties Table 2-25 COM device properties and parameters Property Parameter Description .ComEndedBy(String) String Sets the end setting of COM-based connection types The following values are valid: .
Visual Basic object definitions CRemoteData properties Table 2-26 COM device properties and return values Property Return value Description String = .ComFlowControl String Returns the Com Flow setting of the remote object The following values are valid: String = .ComStartedBy String ■ ■ XONXOFF ■ RTS/CTS ■ Both Returns the Com Start control of COM-based connection types The following values are valid: String = .
Visual Basic object definitions CRemoteData properties Table 2-26 COM device properties and return values Property Return value Description Long = .ComSpeed Long Returns the current setting of the Com Speed of the remote object The following values are valid: ■ 110 ■ 300 ■ 600 ■ 1200 ■ 2400 ■ 4800 ■ 9600 ■ 38400 ■ 57600 ■ 115200 NetBIOS device properties Table 2-27 defines the property and parameter for a NetBIOS network device.
Visual Basic object definitions CRemoteData properties ISDN via CAPI 2.0 device properties Table 2-29 defines the properties and parameters for European ISDN connections. Replace the information in angle brackets with the actual values. Table 2-29 ISDN via CAPI 2.0 properties and parameters Property Parameter Description .CapiChannelBonding(Bool) Bool Activates or deactivates channel bonding for ISDN CAPI devices .
Visual Basic object definitions CRemoteDataEx object CRemoteDataEx object The CRemoteDataEx object contains the same functionality as the CRemoteData object with some additional functionality. Table 2-31 describes the properties and parameters. Replace the information in angle brackets with the actual values. Table 2-31 CRemoteDataEx parameters Property Parameter Description .PrivateKey(String) String Sets the name of the private key container to use. .
Visual Basic object definitions CRemoteDataEx object Table 2-32 CRemoteDataEx properties and return values Property Return value Description Byte = .EncryptionLevel Byte Returns one of the following encryption settings: ■ -1: None ■ 0: pcAnywhere ■ 1: Symmetric ■ 2: Public key Bool = .DenyLowerEncrypt Bool Returns the value of the deny lower encryption setting. String = .AutoDomain String Returns the domain name setting for automatic logins.
Visual Basic object definitions CRemoteDataEx object 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.
Visual Basic object definitions CHostDataManager methods 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.
Visual Basic object definitions CHostDataManager methods Table 2-34 FindFirst parameters Parameter Description Name as string Return buffer for the full path name of the host object file that matches the specified pattern Table 2-35 defines the return value for FindFirst. Table 2-35 FindFirst return value Return value Description Boolean TRUE if a host object file matching the specified pattern is found. The full path name of the matching file is stored in Name.
Visual Basic object definitions CHostDataManager methods RetrieveObject(Name, AccessMode, Password) Retrieves a CHostData object by file name. Table 2-38 defines the parameters for RetrieveObject. Table 2-38 RetrieveObject parameters Parameter Description Name as string The fully qualified host object file name to be loaded. AccessMode as integer Specifies how this object is to be used. This relates to the password protection.
Visual Basic object definitions CHostDataManager methods Table 2-41 defines the return value for RetrieveObjectEx. Table 2-41 RetrieveObjectEx return value Return value Description Object CHostDataEx object from the specified file CreateObject(Name) Creates a CHostData object and returns an LPDISPATCH pointer to it. Table 2-42 defines the parameter for CreateObject.
Visual Basic object definitions CHostDataManager methods DeleteObject(Name, Password) Deletes a host object file. Table 2-46 defines the parameters for DeleteObject. Table 2-46 DeleteObject parameters Parameter Description Name as string The fully qualified host object file name of the object to be deleted Password as string Object password Table 2-47 defines the return value for DeleteObject.
Visual Basic object definitions CHostData properties CHostData properties Table 2-50 describes the properties and parameters that are available for the CHostData object. Replace the information in angle brackets with the actual values. Table 2-50 CHostData properties and parameters Property Parameter Description .PhoneNumber(String) String Sets the phone number of the host computer. .UseDialingProperties(Bool) Bool Sets the system dialing properties. .
Visual Basic object definitions CHostData properties Table 2-51 describes the CHostData properties and return values. Replace the information in angle brackets with the actual values. Table 2-51 CHostData properties and return values Property Return value Description String = .PhoneNumber String Returns the phone number of the host computer Bool = .
Visual Basic object definitions CHostData properties Connection type properties Table 2-52 describes the connection type properties and parameters. Replace the information in angle brackets with the actual values. Table 2-52 Connection type properties and parameters Property Parameter Description .ConnectionType(String) String Sets the connection type of the host.
Visual Basic object definitions CHostData properties Table 2-53 describes the connection type properties and return values. Replace the information in angle brackets with the actual values. Table 2-53 Connection type properties and return values Property Return value Description String = .ConnectionTypes String Returns the connection type of the host object. Integer = .ConnectionType Integer Returns the number of available connection types.
Visual Basic object definitions CHostData properties AssignConnection(ConnectionType) method The AssignConnection(Connection Type) method places the requested connection type on the host object’s list of assigned connection types and makes it the current connection type when processing subsequent device-specific method calls. If the requested connection type is already on the list of assigned connections, the list of assigned connections does not change.
Visual Basic object definitions CHostData properties Table 2-56 defines the UnassignConnection parameter. Table 2-56 UnassignConnection parameter Parameter Description ConnectionType as string The name of a connection device type to be unassigned Table 2-57 defines the UnassignConnection return value.
Visual Basic object definitions CHostData properties Table 2-59 Properties and return values for modem dialing properties Property Return value Description String = .NextCountryCode String Returns the next available country code. This is called sequentially for the number of country codes that is set in .CountryCodes to enumerate all country codes.
Visual Basic object definitions CHostData properties Table 2-60 COM device properties and parameters Property Parameter Description .ComStartedBy(String) String Sets the start setting of COM-based connection types The following values are valid: .
Visual Basic object definitions CHostData properties Table 2-61 describes the COM device properties and return values. Replace the information in angle brackets with the actual values. Table 2-61 COM device properties and return values Property Return value Description String = .ComParity String Returns one of the following values as the communications parity: String = .
Visual Basic object definitions CHostData properties Table 2-61 COM device properties and return values Property Return value Description Long = .ComSpeed Long Returns the current setting of the Com Speed of the host object The following values are valid: ■ 110 ■ 300 ■ 600 ■ 1200 ■ 2400 ■ 4800 ■ 9600 ■ 38400 ■ 57600 ■ 115200 NetBIOS device properties Table 2-62 defines the property and parameter for NetBIOS network devices.
Visual Basic object definitions CHostData properties ISDN via CAPI 2.0 device properties Table 2-64 defines the properties and parameters for European ISDN connections. Replace the information in angle brackets with the actual values. Table 2-64 ISDN via CAPI 2.0 properties and parameters Property Parameter Description .CapiChannelBonding(Bool) Bool Activates or deactivates channel bonding for ISDN CAPI devices .
Visual Basic object definitions CHostDataEx object CHostDataEx object The CHostDataEx object contains the same functionality as the CHostData object with some additional functionality. Table 2-66 describes the properties and parameters. Replace the information in angle brackets with the actual values. Table 2-66 CHostDataEx properties and parameters Property Parameter Description .CryptPrivateKey(String) String Sets the name of the private key container to use. .
Visual Basic object definitions CHostDataEx object Table 2-66 CHostDataEx properties and parameters Property Parameter Description .ActiveKbds(Byte) 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 .InactiveTimeout(Byte) Byte Sets the number of minutes in which the keyboard and mouse can be inactive before the connection is ended. .
Visual Basic object definitions CHostDataEx object Table 2-66 CHostDataEx properties and parameters Property Parameter Description .AuthenticationType(Byte) Byte Sets the authentication type.
Visual Basic object definitions CHostDataEx object Table 2-66 CHostDataEx properties and parameters Property Parameter Description .EndSessSecurity(Byte) Byte 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 .BlankHost(Bool) Bool Sets screen blanking on the host computer. Some video cards do not support this option. .
Visual Basic object definitions CHostDataEx object Table 2-67 CHostDataEx properties and return values Property Return value Description Byte = .CryptReqLevel Byte Returns one of the following encryption settings: ■ -1: None ■ 0: pcAnywhere ■ 1: Symmetric ■ 2: Public key Bool = .CryptRefuseLower Bool Returns the value of the deny lower encryption setting. String = .CallersPath String Returns the currently active path to the caller files.
Visual Basic object definitions CHostDataEx object Table 2-67 CHostDataEx properties and return values Property Return value Description Bool = .RunAsService Bool Returns the run host as a service setting. Byte = .ConnLostWait Byte Returns the number of minutes to wait before allowing another connection. Bool = .ConnLostHostOpts Bool Returns whether to wait for another connection or cancel the host if the session ends abnormally.
Visual Basic object definitions CHostDataEx object Table 2-67 CHostDataEx properties and return values Property Return value Description Byte = .ConnLostSecurity Byte 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 Byte = .
Visual Basic object definitions CHostDataEx object Table 2-67 CHostDataEx properties and return values Property Return value Description Bool = .AllowDriveSecurity Bool Returns whether the drive security option is enabled. Bool = .UseDirectoryServices Bool Returns whether the directory services option is enabled. String = .DirectoryServiceEntry String Returns the directory service settings.
Visual Basic object definitions Awrem32 functions 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.
Visual Basic object definitions Awrem32 functions Table 2-69 defines the awConnect return value. Table 2-69 awConnect return value Return value Description Boolean TRUE if command executed awDisconnect() Disconnects the host computer. Table 2-70 defines the return value. Table 2-70 awDisconnect() return value Return value Description Boolean After calling this function, the calling program must delete the object (C++ - delete IAwrem32X*, VB – set ObjectName = Nothing;).
Visual Basic object definitions Awrem32 functions FileXferToHost(HostFile, RemoteFile) Copies a file from the remote computer to the host computer. The parameters can contain wildcard characters. Table 2-73 defines the FileXferToHost parameters. Table 2-73 FileXferToHost parameters Parameter Description HostFile as string Contains the fully qualified destination path and file name. RemoteFile as string Contains the fully qualified path and file name to be copied from the remote computer.
Visual Basic object definitions Awrem32 functions ExecuteHostFile(FileName) 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. Table 2-77 defines the ExecuteHostFile parameter.
Visual Basic object definitions Awrem32 functions ConnectionStatus() Returns the current status of your connection to the host computer. Table 2-80 defines the return value.
Visual Basic object definitions Awrem32 functions
Chapter 3 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 pcAnywhere Automation Server provides the following components to support OLE Automation: ■ Winawsvr: Provides the information needed to connect to the pcAnywhere Automation Server and access i
Visual C++ object definitions About Visual C++ objects The objects that are described in Table 3-1 comprise Winawsvr. Table 3-1 Winawsvr objects Object Description Reference CRemoteDataManager Provides the methods for creating, opening, modifying, saving, and deleting CRemoteData objects See “CRemoteDataManager methods” on page 71. CRemoteData Defines the parameters for accessing and controlling pcAnywhere remote functionality See “CRemoteData object” on page 77.
Visual C++ object definitions CRemoteDataManager methods CRemoteDataManager methods The CRemoteDataManager methods provide the parameters and return values for accessing and controlling CRemoteData objects. BSTR CurrentDirectory(); Gets the full path name of the current directory in which pcAnywhere remote objects are stored. Table 3-2 defines the parameter.
Visual C++ object definitions CRemoteDataManager methods BOOL FindFirst(LPCTSTR lpszPattern, BSTR FAR* pbstrFullQualName); Finds the first pcAnywhere remote object file (*.chf) in the current directory, based on the specified file name pattern. Table 3-5 defines the parameters.
Visual C++ object definitions CRemoteDataManager methods Table 3-8 defines the return value. Table 3-8 BOOL FindNext return value Return value Description BOOL TRUE if another remote object file matching the pattern specified in the call to FindFirst() is found. The full path name of the matching file is stored in pbstrFullQualName. LPDISPATCH RetrieveObject(LPCTSTR lpszFQName, short wAccessMode, LPCTSTR lpszPassword); Retrieves a CRemoteData object by file name. Table 3-9 defines the parameters.
Visual C++ object definitions CRemoteDataManager methods Table 3-10 LPDISPATCH RetrieveObjectEx parameters Parameter Description short wAccessMode Specifies how this object is to be used. This relates to the password protection. The options are as follows: LPCTSTR lpszPassword ■ 0 = Not specified ■ 1 = View only ■ 2 = View and Modify ■ 3 = Execute Object password. May be NULL. Table 3-11 defines the return value.
Visual C++ object definitions CRemoteDataManager methods Table 3-13 defines the return value. Table 3-13 LPDISPATCH CreateObject return value Return value Description LPDISPATCH Pointer to an OLE dispatch object. The object is a CRemoteData object. For an example of how to attach this pointer to a CRemoteData object, see “Visual C++ sample code for remote functionality” on page 85. LPDISPATCH CreateObjectEx(LPCTSTR lpszFQName); Creates a CRemoteDataEx object and returns an LPDISPATCH pointer to it.
Visual C++ object definitions CRemoteDataManager methods BOOL DeleteObject(LPCTSTR lpszFQName, LPCTSTR lpszPassword); Deletes a remote object file. Table 3-16 defines the parameters. Table 3-16 BOOL DeleteObject parameters Parameter Description LPCTSTR lpszFQName The fully qualified remote object file name of the object to be deleted. LPCTSTR lpszPassword Object password. May be NULL. Table 3-17 defines the return value.
Visual C++ object definitions CRemoteData object 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. BSTR GetComputerName(); void SetComputerName(LPCTSTR lpszNewValue); The phone number is the number to dial to establish a modem connection to a pcAnywhere host computer.
Visual C++ object definitions CRemoteData object 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); The password for this object. BSTR GetPassword(); void SetPassword(LPCTSTR lpszNewValue); The object can only be launched if the password is used (TRUE).
Visual C++ object definitions CRemoteData object ■ COM4 ■ Infrared ■ ISDN via CAPI 2.0 ■ LPT1 ■ LPT2 ■ LPT3 ■ LPT4 ■ 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.
Visual C++ object definitions CRemoteData object ■ Space Sets the flow control level. BSTR GetComFlowControl(); void SetComFlowControl(LPCTSTR lpszNewValue); Flow control values are as follows: ■ ■ XONXOFF ■ RTS/CTS ■ BOTH Sets the connection start setting.
Visual C++ object definitions CRemoteData object Sets the connection speed. long GetComSpeed(); void SetComSpeed(long nNewValue); Connection speed values are as follows: ■ 110 ■ 300 ■ 600 ■ 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.
Visual C++ object definitions CRemoteData object Remote object methods The following are the normal methods of the remote object (they are not used to get and set properties): ■ short ConnectionTypes(); ■ BSTR FirstConnectionType(); and BSTR NextConnectionType(); ■ BOOL FindConnectionType(LPCTSTR lpszConnectionType); ■ short CountryCodes(); ■ BSTR FirstCountryCode(); and BSTR NextCountryCode(); ■ BOOL ReadObject(LPCTSTR lpszPassword); ■ BOOL WriteObject(LPCTSTR lpszPassword); short Connect
Visual C++ object definitions CRemoteData object BOOL FindConnectionType(LPCTSTR lpszConnectionType); Returns TRUE if the connection type that is passed in exists on the computer. Table 3-22 defines the parameter. Table 3-22 BOOL FindConnectionType parameter Parameter Description LPCTSTR lpszConnectionType The name of a connection device type Table 3-23 defines the return value.
Visual C++ object definitions CRemoteData object BOOL ReadObject(LPCTSTR lpszPassword); Reads the object data from the remote object file. Table 3-26 defines the parameter. Table 3-26 BOOL ReadObject parameter Parameter Description LPCTSTR lpszPassword The object password Table 3-27 defines the return value.
Visual C++ object definitions CRemoteDataEx object CRemoteDataEx object The CRemoteDataEx object contains the same functionality as the CRemoteData object with the following additional Get and Set methods: BSTR GetPrivateKey(); //Returns the PrivateKey information void SetPrivateKey(LPCTSTR lpszNewValue); BSTR GetCertificationName(); //Returns the Certification Name void SetCertificationName(LPCTSTR lpszNewValue); short GetEncryptionLevel(); //Returns the encryption level value void SetEncryptionLevel(shor
Visual C++ object definitions CHostDataManager methods { // And launch it if (remoteData.Launch()) bReturn = TRUE; } // Release the remote object. remoteData.ReleaseDispatch(); remoteDM.ReleaseDispatch( _T( “WINAWSVR.RemoteDataManager”) ); return bReturn; } CHostDataManager methods The CHostDataManager methods provide the parameters and return values for accessing and controlling CHostData objects.
Visual C++ object definitions CHostDataManager methods Table 3-32 defines the return value. Table 3-32 BOOL ChangeDirectory return value Return value Description BOOL TRUE if successful BOOL FindFirst(LPCTSTR lpszPattern, BSTR FAR* pbstrFullQualName); Finds the first pcAnywhere host object file (*.bhf) in the current directory, based on the specified file name pattern. Table 3-33 defines the parameters.
Visual C++ object definitions CHostDataManager methods Table 3-35 defines the parameter. Table 3-35 BOOL FindNext parameter Parameter Description BSTR FAR * pbstrFullQualName Return buffer for the full path name of the host object file that matches the pattern specified in the original call to FindFirst() Table 3-36 defines the return value.
Visual C++ object definitions CHostDataManager methods Table 3-38 defines the return value. Table 3-38 LPDISPATCH RetrieveObject return value Return value Description LPDISPATCH Pointer to an OLE dispatch object. The object is a CHostData object. For an example of how to attach this pointer to a CHostData object, see “Visual C++ sample code for host functionality” on page 103.
Visual C++ object definitions CHostDataManager methods LPDISPATCH CreateObject(LPCTSTR lpszName); Creates a CHostData object and returns an LPDISPATCH pointer to it. Table 3-41 defines the parameter. Table 3-41 LPDISPATCH CreateObject parameter Parameter Description LPCTSTR lpszFQName The fully qualified host object file name for the new object Table 3-42 defines the return value.
Visual C++ object definitions CHostDataManager methods BOOL DeleteObject(LPCTSTR lpszFQName, LPCTSTR lpszPassword); Deletes a host object file. Table 3-45 defines the parameters. Table 3-45 BOOL DeleteObject parameters Parameter Description LPCTSTR lpszFQName The fully qualified host object file name of the object to be deleted. LPCTSTR lpszPassword Object password. May be NULL. Table 3-46 defines the return value.
Visual C++ object definitions CHostData object CHostData object Use this object to modify host object data. Get and Set methods The following methods are used to get and set properties of the CHostData object. The phone number is the number to dial to establish a modem connection to a pcAnywhere remote computer.
Visual C++ object definitions CHostData object 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.
Visual C++ object definitions CHostData object ■ SPX ■ NetBIOS ■ TCP/IP ■ LPT1 ■ LPT2 ■ LPT3 ■ LPT4 ■ ISDN via CAPI 2.0 ■ Infrared ■ 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.
Visual C++ object definitions CHostData object ■ RTS/CTS ■ 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 's ■ Modem response The following code sets the connection end values: BSTR GetComEndedBy(); void SetComEndedBy(LPCTSTR lpszNewValue); Connec
Visual C++ object definitions CHostData object ■ 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.
Visual C++ object definitions CHostData object 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.
Visual C++ object definitions CHostData object BSTR FirstConnectionType(); and BSTR NextConnectionType(); FirstConnectionType() and NextConnectionType() are used to iterate through the available connection types. The functions return a BSTR, which is the name of an available connection type. You can use these returned connection types with the SetConnectionType() function. Table 3-50 defines the return value.
Visual C++ object definitions CHostData object short AssignedConnections() Returns the number of assigned connection types. Table 3-54 defines the return value. Table 3-54 short AssignedConnections() return value Return value Description Short The number of assigned connection types on this computer BSTR FirstAssignedConnection(); and BSTR NextAssignedConnection(); FirstAssignedConnection() and NextAssignedConnection() are used to iterate through the list of assigned connections.
Visual C++ object definitions CHostData object Table 3-57 defines the return value. Table 3-57 BOOL FindAssignedConnection return value Return value Description BOOL TRUE if this device type is currently assigned short CountryCodes(); Returns the number of country codes available. Table 3-58 defines the return value.
Visual C++ object definitions CHostDataEx object Table 3-61 defines the return value. Table 3-61 BOOL ReadObject return value Return value Description BOOL TRUE if object is successfully read BOOL WriteObject(LPCTSTR lpszPassword); Writes the object data out to the host object file. Table 3-62 defines the parameter. Table 3-62 BOOL WriteObject parameter Parameter Description LPCTSTR lpszPassword The object password Table 3-63 defines the return value.
Visual C++ object definitions CHostDataEx object 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)
Visual C++ object definitions CHostDataEx object 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 nNewVal
Visual C++ object definitions Awrem32 functions // 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); } Awrem32 functions The Awrem32 functions provide the parameters and return values for handling connections between a host and remote computer.
Visual C++ object definitions Awrem32 functions boolean awDisconnect(); Disconnects the host computer. Table 3-66 defines the return value. Table 3-66 boolean awDisconnect(); return value Return value Description Boolean After calling this function, the calling program must delete the object (C++ - delete IAwrem32X*, VB – set ObjectName = Nothing;). boolean FileXferFromHost(BSTR HostFile, BSTR RemoteFile); Copies a file from the host computer to the remote computer.
Visual C++ object definitions Awrem32 functions Table 3-69 defines the parameters. Table 3-69 boolean FileXferToHost parameters Parameter Description HostFile as string Contains the fully qualified destination path and file name. RemoteFile as string 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. Table 3-70 defines the return value.
Visual C++ object definitions Awrem32 functions Table 3-73 defines the parameter. Table 3-73 boolean ExecuteHostFile parameter Parameter Description FileName as string Contains the fully qualified path to the file on the host computer Table 3-74 defines the return value. Table 3-74 boolean ExecuteHostFile return value Return value Description Boolean TRUE if command executed BSTR GetError(); Returns the last error as a string. Table 3-75 defines the return value.
Visual C++ object definitions Awrem32 functions
Index A API libraries 16 automation controllers about Visual Basic 14 about Visual C++ 15 automation server. See pcAnywhere Automation Server Awrem32 functions 63, 104 type library 16 C C++.
Index H P host objects creating 42, 90 deleting 43, 91 device details 93 dialing properties 49 directories 39, 86 finding 40-42, 87-89 methods 97 passwords 100 starting 43, 91 parity 31, 50, 79, 94 passwords on host objects 100 on remote objects 84 pcAnywhere Automation Server about 12 accessing with Visual Basic 14 accessing with Visual C++ 15 example uses 12 registering GUIDs 13 type libraries 16 I identifiers.
Index Visual Basic (continued) CRemoteDataManager object 20 Visual C++ accessing pcAnywhere Automation Server 15 Awrem32 functions 104 CHostData object 92 CHostDataEx object 101 CHostDataManager object 86 code samples 85, 103 CRemoteData object 77 CRemoteDataEx object 85 CRemoteDataManager object 71 importing classes 16 including Winawsvr.
Index