background image

14 Using OLE Automation with Symantec pcAnywhere

Before you start

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 Basic programming language has built-in support to 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.

See

“Visual Basic object definitions”

 on page 19.

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 object’s data manager.
For example, call the CreateObject method with 
WINAWSVR.REMOTEDATAMANAGER as a parameter. 
Visual Basic uses the textual parameter to locate the manager’s identifier in 
the registry and returns the interface to that manager. 

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. 

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 property’s name to differentiate 
between getting and setting its value. Instead, the property’s position in 
relation to the assignment operator determines whether the underlying 
method call is a Get or a Set. 

Содержание PCANYWHERE - OLE AUTOMATION GUIDE V12.1

Страница 1: ...Symantec pcAnywhere OLE Automation Guide ...

Страница 2: ...es and are respectfully acknowledged 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 THIS DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIE...

Страница 3: ...atic software upgrade protection Global support that is available 24 hours a day 7 days a week worldwide Support is provided in a variety of languages for those customers that are enrolled in the Platinum Support program Advanced features including Technical Account Management For information about Symantec s Maintenance Programs you can visit our Web site at the following URL www symantec com tec...

Страница 4: ...ntec com techsupp ent enterprise html Select your region or language under Global Support and then select the Licensing and Registration page Customer service Customer service information is available at the following URL www symantec com techsupp ent enterprise html Select your country or language under Global Support Customer Service is available to assist with the following types of issues Ques...

Страница 5: ... Services please visit our Web site at the following URL www symantec com Select your country or language from the site index Symantec Early Warning Solutions These solutions provide early warning of cyber attacks comprehensive threat analysis and countermeasures to prevent attacks before they occur Managed Security Services These services remove the burden of managing and monitoring security devi...

Страница 6: ......

Страница 7: ...host and remote OLE objects 17 Where to find more information 17 Chapter 2 Visual Basic object definitions About Visual Basic objects 19 CRemoteDataManager methods 20 CurrentDirectory 20 ChangeDirectory NewDirectory 21 FindFirst Pattern Name string 21 FindNext Name 22 RetrieveObject Name AccessMode Password 23 RetrieveObjectEx Name AccessMode Password 23 CreateObject Name 24 CreateObjectEx Name 24...

Страница 8: ...type properties 46 AssignConnection ConnectionType method 48 UnassignConnection ConnectionType method 48 Dialing properties 49 COM device properties 50 NetBIOS device properties 53 ISDN via CAPI 2 0 device properties 54 CHostDataEx object 55 Visual Basic sample code for host functionality 62 Awrem32 functions 63 awConnect FileName 63 awDisconnect 64 FileXferFromHost HostFile RemoteFile 64 FileXfer...

Страница 9: ...me 76 CRemoteData object 77 Get and Set methods 77 Remote object Detail methods 79 Remote object methods 82 CRemoteDataEx object 85 Visual C sample code for remote functionality 85 CHostDataManager methods 86 BSTR CurrentDirectory 86 BOOL ChangeDirectory LPCTSTR lpszNewDirectory 86 BOOL FindFirst LPCTSTR lpszPattern BSTR FAR pbstrFullQualName 87 BOOL FindNext BSTR FAR pbstrFullQualName 87 LPDISPAT...

Страница 10: ...an awConnect BSTR FileName 104 boolean awDisconnect 105 boolean FileXferFromHost BSTR HostFile BSTR RemoteFile 105 boolean FileXferToHost BSTR HostFile BSTR RemoteFile 105 boolean CreateFolderOnHost BSTR FolderName 106 boolean ExecuteHostFile BSTR FileName 106 BSTR GetError 107 short ConnectionStatus 107 Index ...

Страница 11: ...lets you create an external application or other development tool such as a script or macro that can control and automate any exposed function within an application OLE Automation consists of the following components OLE Automation server An application or software component that exposes its functionality so that it can be accessed or controlled by other applications or development tools The pcAny...

Страница 12: ...ere 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 TAPI device is assigned by default Similarly when you create a host object using the...

Страница 13: ...gine on page 13 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 You can do this automatically when you 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 Syman...

Страница 14: ... See Visual Basic object definitions on page 19 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 object s data manager For example call the CreateObje...

Страница 15: ...y that is needed to obtain an interface to the pcAnywhere Automation Server and perform high level operations on the interface s associated object type Use the data manager object to do the following Determine or change the current directory Enumerate through the list of data object files in the current directory Create retrieve or delete a named object Once created or retrieved an object uses the...

Страница 16: ...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 from the type libraries also adds support files to the application These files contain the clas...

Страница 17: ...te 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 ...

Страница 18: ...18 Using OLE Automation with Symantec pcAnywhere Where to find more information ...

Страница 19: ...stDataManager 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 Server and access its interfaces Awrem32 Provides the information needed to control pcAnywhere connections ...

Страница 20: ... CRemoteData objects CurrentDirectory Returns the full path name of the current directory in which pcAnywhere remote objects are stored 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 co...

Страница 21: ...me pattern Table 2 5 defines the FindFirst parameters Table 2 2 CurrentDirectory return value Return value Description String The full path name of the current pcAnywhere data directory Table 2 3 ChangeDirectory parameter Parameter Description NewDirectory Name of an existing directory Table 2 4 ChangeDirectory return value Return value Description Boolean TRUE if successful Table 2 5 FindFirst pa...

Страница 22: ...eturn 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 Table 2 7 FindNext parameter Parameter Description Name as string Return buffer for the full path name of the remote object file that matches the pattern that is specified in the original call to FindFirst Table 2 8 FindNext...

Страница 23: ...ed AccessMode as integer 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 Password as string Object password May be NULL Table 2 10 RetrieveObject return value Return value Description Object CRemoteData object from the specified file Table 2 11 RetrieveObjectEx parameters Parameter De...

Страница 24: ...jectEx parameter Table 2 16 defines the CreateObjectEx return value Table 2 12 RetrieveObjectEx return value Return value Description Object CRemoteDataEx object from the specified file Table 2 13 CreateObject parameter Parameter Description Name as string The fully qualified remote object file name for the new object Table 2 14 CreateObject return value Return value Description Object CRemoteData...

Страница 25: ...leteObject parameters Table 2 18 defines the DeleteObject return value 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 DeleteObject return value Return value Description Boolean TRUE if object is deleted ...

Страница 26: ... more information about using domain logins see CRemoteDataEx object on page 36 CRemoteData AutoLoginPassword String String Sets the password for automatic logins in the remote object For security reasons the pcAnywhere Automation Server does not provide the ability to read the password value A password value is not returned CRemoteData Password String String Sets the password on the remote object...

Страница 27: ...puter name or IP address of the host computer String CRemoteData PhoneNumber String Returns the phone number of the host computer Bool CRemoteData UseDialingProperties Bool Returns the system dialing properties that are set in the remote object Integer CRemoteData RedialCount Integer Returns the number of redial attempts that is set in the remote object Integer CRemoteData RedialDelay Integer Retu...

Страница 28: ...rties and return values Property Return value Description Table 2 21 Connection type properties and parameters Property Parameter Description CRemoteData ConnectionType String String Sets the connection type of the remote The value that is passed in must be a valid connection type as defined by the FirstConnectionType and NextConnectionType functions The following are examples of valid connection ...

Страница 29: ...ion types The following are examples of valid connection types COM1 COM2 COM3 COM4 LPT1 LPT2 LPT3 LPT4 TCP IP SPX NetBIOS Infrared ISDN via CAPI 2 0 Modem name as it appears on the computer String CRemoteData FirstConnectionType String Returns the first available connection type String CRemoteData NextConnectionType String Returns the next available connection type This is called sequentially for ...

Страница 30: ...s CRemoteData CountryCode String String Sets the country code dialing properties for modem connections Table 2 24 Properties and return values for dialing properties Property Return value Description String CRemoteData AreaCode String Returns the area code dialing properties String CRemoteData CountryCode String Returns the dialing properties country code Integer CRemoteData CountryCodes Integer R...

Страница 31: ...Parameter Description CRemoteData ComParity String String Sets the communications parity The following values are valid None Odd Even Mark Space CRemoteData ComFlowControl String String Sets the flow control of COM based connection types The following values are valid None XONXOFF RTS CTS Both CRemoteData ComStartedBy String String Sets the start setting of COM based connection types The following...

Страница 32: ...nected Carrier detect DCD Clear to send CTS Data set ready DSR Ring indicator RI CRemoteData ComSpeed Long Long Contains the maximum COM speed setting The following values are valid 110 300 600 1200 2400 4800 9600 38400 57600 115200 Table 2 26 COM device properties and return values Property Return value Description String CRemoteData ComParity String Returns one of the following values for commun...

Страница 33: ...COM based connection types The following values are valid Always connected Carrier detect DCD Clear to send CTS Data set ready DSR Ring indicator RI Receive 2 CR s Modem response String CRemoteData ComEndedBy String 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 Tabl...

Страница 34: ...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 Table 2 26 COM device properties and return values Property Return value Description Table 2 27 NetBIOS property and parameter Property Parameter Description CRemoteData LanaNumber Integer Integer Sets the LAN Adapter LANA number for NetBIOS connections Table 2 28...

Страница 35: ... via CAPI 2 0 properties and parameters Property Parameter Description CRemoteData CapiChannelBonding Bool Bool Activates or deactivates channel bonding for ISDN CAPI devices CRemoteData CapiExtensions String String Sets any additional CAPI extensions that are needed for communications Table 2 30 ISDN via CAPI 2 0 properties and return values Property Return value Description Bool CRemoteData Capi...

Страница 36: ...emoteData CertificateName String String Sets the common name of the private key to use CRemoteData EncryptionLevel Byte Byte Sets the encryption level The following values are valid 1 None 0 pcAnywhere 1 Symmetric 2 Public key CRemoteData DenyLowerEncrypt Bool Bool Defines whether the remote computer allows a connection to a host computer that uses a lower level of encryption CRemoteData AutoDomai...

Страница 37: ...nager ChangeDirectory C dev bin w32 data s RemoteDataManager CurrentDirectory MsgBox s retrieve remote data object Set RemoteData RemoteDataManager RetrieveObjectEx pod CHF 2 0 display some properties s RemoteData AreaCode Byte CRemoteData EncryptionLevel Byte Returns one of the following encryption settings 1 None 0 pcAnywhere 1 Symmetric 2 Public key Bool CRemoteData DenyLowerEncrypt Bool Return...

Страница 38: ... 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 Create a remote object Set the connection type to TCP IP and the computer name Host1 and then launch it as follows Private Sub Command6_Click Dim Re...

Страница 39: ...ontrolling CHostData objects CurrentDirectory Returns the full path name of the current directory in which pcAnywhere host objects are stored Table 2 33 defines the return value for CurrentDirectory FindFirst Pattern Name string Finds the first pcAnywhere host object file bhf in the current directory based on the specified file name pattern Table 2 34 defines the parameters for FindFirst Table 2 3...

Страница 40: ...hes the specified pattern 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 Table 2 34 FindFirst parameters Parameter Description Table 2 36 FindNext parameter Parameter Description Name as string Return buffer for the full path name of the host object file ...

Страница 41: ... loaded AccessMode as integer 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 Password as string Object password May be NULL Table 2 39 RetrieveObject return value Return value Description Object CHostData object from the specified file Table 2 40 RetrieveObjectEx parameters Parameter...

Страница 42: ...meter for CreateObjectEx Table 2 45 defines the return value for CreateObjectEx Table 2 41 RetrieveObjectEx return value Return value Description Object CHostDataEx object from the specified file Table 2 42 CreateObject parameter Parameter Description Name as string The fully qualified host object file name for the new object Table 2 43 CreateObject return value Return value Description Object CHo...

Страница 43: ... Table 2 49 defines the Launch return value 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 DeleteObject return value Return value Description Boolean TRUE if object is deleted Table 2 48 Launch parameter Parameter Description Name as string The fully qualifie...

Страница 44: ...erver does not provide the ability to read the password value A password value is not returned CHostData ExecuteProtection Bool Bool Sets the requirement of a password to execute the object Set by Password CHostData ReadProtection Bool Bool Sets the requirement of a password to view the properties of the host object Set by Password CHostData WriteProtection Bool Bool Sets the requirement of a pass...

Страница 45: ...Count Integer Returns the number of redial attempts that is set in the host object Integer CHostData RedialDelay Integer Returns the number of seconds between redial attempts Bool CHostData ExecuteProtection Bool Returns the value of the ExecuteProtection setting Bool CHostData ReadProtection Bool Returns the value of the ReadProtection setting Bool CHostData WriteProtection Bool Returns the value...

Страница 46: ... type of the host The value that is passed in must be a valid connection type as defined by the FirstConnectionType and NextConnectionType functions The following are examples of valid connection types COM1 COM2 COM3 COM4 LPT1 LPT2 LPT3 LPT4 TCP IP SPX NetBIOS Infrared ISDN via CAPI 2 0 Modem name as it appears on the computer CHostData AssignConnection String String Sets the connection type that ...

Страница 47: ...rns the first available connection type String CHostData NextConnectionType String Returns the next available connection type This is called sequentially for the number of connection types that is set in CHostData ConnectionTypes to enumerate all connection types Bool CHostData FindConnectionType ConnectionType Bool Returns TRUE if the named connection type is found in the list of available connec...

Страница 48: ...signed 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 Table 2 54 defines the AssignConnection par...

Страница 49: ...e to be unassigned Table 2 57 UnassignConnection return value Return value Description Boolean TRUE if this device type is successfully unassigned Table 2 58 Properties and parameters for modem dialing properties Property Parameter Description CHostData AreaCode String String Sets the area code for the modem connections CHostData CountryCode String String Sets the country code for modem connection...

Страница 50: ...led sequentially for the number of country codes that is set in CHostData CountryCodes to enumerate all country codes Table 2 59 Properties and return values for modem dialing properties Property Return value Description Table 2 60 COM device properties and parameters Property Parameter Description CHostData ComParity String String Sets the communications parity The following values are valid None...

Страница 51: ... RI Receive 2 CR s Modem response CHostData ComEndedBy String 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 CHostData ComSpeed Long Long Sets the maximum COM speed setting The following values are valid 110 300 600 1200 2400 4800 9600 38400 57600 115200 Table 2 60 C...

Страница 52: ...g CHostData ComFlowControl String Returns the Com Flow setting of the host object The following values are valid None XONXOFF RTS CTS Both String CHostData ComStartedBy String 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 String CHost...

Страница 53: ...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 Table 2 61 COM device properties and return values Property Return value Description Table 2 62 NetBIOS property and parameter Property Parameter Description CHostData LanaNumber Integer Integer Sets the LAN Adapter LANA number for NetBIOS connectio...

Страница 54: ... parameters Property Parameter Description CHostData CapiChannelBonding Bool Bool Activates or deactivates channel bonding for ISDN CAPI devices CHostData CapiExtensions String String Sets any additional CAPI extensions that are needed for communications Table 2 65 ISDN via CAPI 2 0 properties and return values Property Return value Description Bool CHostData CapiChannelBonding Bool Returns the cu...

Страница 55: ...ower Bool Bool Defines whether the host computer accepts connections from a remote computer that uses a lower level of encryption CHostData CallersPath String String Sets the fully qualified path to the caller files CHostData ConfirmConnect Bool Bool Defines whether the host user will be prompted to confirm connections CHostData ConfirmTimeout Byte Byte Sets the number of seconds before the prompt...

Страница 56: ...a MinimizeOnLaunch Bool Bool Sets the run minimized host startup option CHostData RunAsService Bool Bool Enables the host to run as a service CHostData ConnLostWait Byte Byte Sets the number of minutes to wait before allowing another caller to connect CHostData ConnLostHostOpts Bool Bool Defines whether to wait for another connection or cancel the host if the session ends abnormally The following ...

Страница 57: ...stData ConnLostSecurity Byte 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 CHostData CallbkDelay Byte Byte Sets the number of seconds to wait before the host modem calls back the remote CHostData EndSessHostOpts Bool Bool Defines whether the host waits for another connection or is cancell...

Страница 58: ...omputer to restart after any end of session if TRUE CHostData PasswordAfterDisc Bool Bool Logs off the user after the session ends CHostData LogFailures Bool Bool Logs failed password attempts CHostData AllowDriveSecurity Bool Bool Enables drive security options This setting is valid only on NTFS file systems CHostData UseDirectoryServices Bool Bool Enables the use of directory services for authen...

Страница 59: ... CHostDataEx PwCaseSensitive Bool Returns the value of the make passwords case sensitive setting Byte CHostDataEx PwAttempts Byte Returns the value of the limit login attempts per call setting Byte CHostDataEx PwTimeout Byte Returns the value of the limit time to complete login setting in minutes Byte CHostDataEx ActiveKbds Byte Returns the active keyboard and mouse settings The following values a...

Страница 60: ...t Bool Returns the value of the security option that is set for handling an abnormal end of session Byte CHostDataEx AuthenticationType Byte 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 Netscape LDAP 12 Novell LDAP 13...

Страница 61: ...rns whether the end of session security options are enabled for a normal end of session Byte CHostDataEx EndSessSecurity Byte 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 Bool CHostDataEx BlankHost Bool Returns the screen blanking option that is set Bool CHostDataEx AllowRemoteMouse Bool Re...

Страница 62: ...tDataManager 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 RemoteData HostData 212 Bool CHostDataEx AllowDriveSecurity Bool Returns whether the drive security option is enabled B...

Страница 63: ...AWSVR 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 awConnect FileName Creates the connection to the host computer Table 2 68 defines the awConnect para...

Страница 64: ...alue Return value Description Boolean TRUE if command executed 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 Table 2 71 FileXferFromHost parameters Parameter Description HostFile as string Contains the fully qualified path and file name to be copied from the h...

Страница 65: ...arameter Table 2 76 defines the CreateFolderOnHost return values 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 The HostFile and RemoteFile strings do not have to be identical Table 2 74 FileXferToHost ...

Страница 66: ... Table 2 77 defines the ExecuteHostFile parameter Table 2 78 defines the ExecuteHostFile return value GetError Returns the last error as a string Table 2 79 defines the return value Table 2 77 ExecuteHostFile parameter Parameter Description FileName as string Contains the fully qualified path to the file on the host computer Table 2 78 ExecuteHostFile return value Return value Description Boolean ...

Страница 67: ... Returns the current status of your connection to the host computer Table 2 80 defines the return value Table 2 80 ConnectionStatus return value Return value Description Short The possible values include the following 1 Lost connection 0 No connection 1 Session connected ...

Страница 68: ...68 Visual Basic object definitions Awrem32 functions ...

Страница 69: ...DataManager 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 its interfaces Awrem32 Provides the information needed to control pcAnywhere connections ...

Страница 70: ...able 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 See CRemoteDataEx object on page 85 CHostDataManager Provides...

Страница 71: ... the parameter BOOL ChangeDirectory LPCTSTR lpszNewDirectory Changes the current directory in which pcAnywhere remote objects are stored Table 3 3 defines the parameter Table 3 4 defines the return value Table 3 2 BSTR CurrentDirectory parameter Parameter Description BSTR The full path name of the current pcAnywhere data directory Table 3 3 BOOL ChangeDirectory parameter Parameter Description LPCT...

Страница 72: ... defines the parameter Table 3 5 BOOL FindFirst parameters Parameter Description LPCTSTR lpszPattern File name pattern to filter object files an asterisk finds all files in the current directory BSTR FAR pbstrFullQualName Return buffer for the full path name of the remote object file that matches the specified pattern Table 3 6 BOOL FindFirst return value Return value Description BOOL TRUE if a re...

Страница 73: ...E 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 Table 3 9 LPDISPATCH Retrieve Object parameters Parameter Description LPCTSTR lpszFQName The fully qualified remote object file name to be loaded short wAccessMode Specifies how this object is to be used This relates to the password...

Страница 74: ...ly 2 View and Modify 3 Execute LPCTSTR lpszPassword Object password May be NULL Table 3 11 LPDISPATCH RetrieveObjectEx return value Return value Description LPDISPATCH Pointer to an OLE dispatch object The object is a CRemoteDataEx object For an example of how to attach this pointer to a CRemoteDataEx object see Visual C sample code for remote functionality on page 85 Table 3 10 LPDISPATCH Retriev...

Страница 75: ... 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 Table 3 14 LPDISPATCH CreateObjectEx parameter Parameter Description LPCTSTR lpszFQName The fully qualified remote object file name for the new object Table 3 15 LPDISPATCH CreateObjectEx return value Return value Description LPDISPATCH P...

Страница 76: ...9 defines the return value 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 BOOL DeleteObject return value Return value Description BOOL TRUE if object is deleted Table 3 18 BOOL Launch parameter Parameter Description LPCTSTR lpszFQName...

Страница 77: ...mation 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 Ge...

Страница 78: ... 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 ob...

Страница 79: ...tionType 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 le...

Страница 80: ...ing 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 s...

Страница 81: ...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 ...

Страница 82: ...on types available Table 3 20 defines the return value BSTR FirstConnectionType and BSTR NextConnectionType FirstConnectionType and NextConnectionType are used 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 Table 3 21 defines the return ...

Страница 83: ...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 Table 3 25 defines the return value Table 3 22 BOOL FindConnectionType parameter Parameter Description LPCTSTR lpszConnectionType The name of a connection device type Table 3 23 BOOL FindConnectionType return value Return value Description BOOL TRUE ...

Страница 84: ...t file Table 3 28 defines the parameter Table 3 29 defines the return value Table 3 26 BOOL ReadObject parameter Parameter Description LPCTSTR lpszPassword The object password Table 3 27 BOOL ReadObject return value Return value Description BOOL TRUE if object is successfully read Table 3 28 BOOL WriteObject parameter Parameter Description LPCTSTR lpszPassword The object password Table 3 29 BOOL W...

Страница 85: ...OL 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 FA...

Страница 86: ...ects BSTR CurrentDirectory Returns the full path name of the current directory in which pcAnywhere host objects are stored Table 3 30 defines the return value BOOL ChangeDirectory LPCTSTR lpszNewDirectory Changes the current directory in which pcAnywhere host objects are stored Table 3 31 defines the parameter Table 3 30 BSTR CurrentDirectory return value Return value Description BSTR The full pat...

Страница 87: ...ory FindNext can be called to find the next file that matches the pattern if any Table 3 32 BOOL ChangeDirectory return value Return value Description BOOL TRUE if successful Table 3 33 BOOL FindFirst parameters Parameter Description LPCTSTR lpszPattern File name pattern to filter object files an asterisk finds all host files in the current directory BSTR FAR pbstrFullQualName Return buffer for th...

Страница 88: ... specified in the original call to FindFirst Table 3 36 BOOL FindNext return value Return value Description BOOL 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 Table 3 37 LPDISPATCH RetrieveObject parameters Parameter Description LPCTSTR lpszFQName The fully qualified host obje...

Страница 89: ...Visual C sample code for host functionality on page 103 Table 3 39 LPDISPATCH RetrieveObjectEx parameters Parameter Description LPCTSTR lpszFQName The fully qualified host object file name to be loaded short wAccessMode 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 LPCTSTR lpszPassw...

Страница 90: ...e name for the new object Table 3 42 LPDISPATCH CreateObject 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 Table 3 43 LPDISPATCH CreateObjectEx parameter Parameter Description LPCTSTR lpszFQName The full...

Страница 91: ...defines the return value 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 BOOL DeleteObject return value Return value Description BOOL TRUE if object is deleted Table 3 47 BOOL Launch parameter Parameter Description LPCTSTR lpszFQName The...

Страница 92: ...rties 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 ...

Страница 93: ...signConnection 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 retur...

Страница 94: ...de 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 E...

Страница 95: ...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 nNewValu...

Страница 96: ...ssword 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 Ge...

Страница 97: ...et and set properties short ConnectionTypes BSTR FirstConnectionType and BSTR NextConnectionType BOOL FindConnectionType LPCTSTR lpszConnectionType short MaxAssignedConnections short AssignedConnections BSTR FirstAssignedConnection and BSTR NextAssignedConnection BOOL FindAssignedConnection LPCTSTR lpszConnectionType short CountryCodes BSTR FirstCountryCode and BSTR NextCountryCode BOOL ReadObject...

Страница 98: ...he parameter Table 3 52 defines the return value short MaxAssignedConnections Returns the maximum number of connection types that can be assigned at the same time currently two Table 3 53 defines the return value Table 3 50 BSTR FirstConnectionType and BSTR NextConnectionType return value Return value Description BSTR The name of a supported connection device type Table 3 51 BOOL FindConnectionTyp...

Страница 99: ...Connection function Table 3 55 defines the return value BOOL FindAssignedConnection LPCTSTR lpszConnectionType Returns TRUE if the connection type that is passed in is currently assigned on the computer Table 3 56 defines the parameter Table 3 54 short AssignedConnections return value Return value Description Short The number of assigned connection types on this computer Table 3 55 BSTR FirstAssig...

Страница 100: ...tCountryCode function Table 3 59 defines the return value BOOL ReadObject LPCTSTR lpszPassword Reads the object data from the host object file Table 3 60 defines the parameter Table 3 57 BOOL FindAssignedConnection return value Return value Description BOOL TRUE if this device type is currently assigned Table 3 58 short CountryCodes return value Return value Description Short The number of country...

Страница 101: ...Value 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 Table 3 61 BOOL ReadObject return value Return value Description BO...

Страница 102: ...yptRefuseLower BOOL bNewValue 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 SetConnLostHostOp...

Страница 103: ...sc BOOL bNewValue BOOL GetLogFailures void SetLogFailures BOOL bNewValue BOOL GetAllowDriveSecurity void SetAllowDriveSecurity BOOL bNewValue BOOL GetExecuteProtection void SetExecuteProtection BOOL bNewValue Visual C sample code for host functionality The following sample Visual C function creates a host object sets its connection type to TCP IP sets the computer name to the TCP IP address that i...

Страница 104: ...ctions provide the parameters and return values for handling connections between a host and remote computer boolean awConnect BSTR FileName Creates the connection to the host computer Table 3 64 defines the parameter Table 3 65 defines the return value Table 3 64 boolean awConnect parameter Parameter Description Name as string The fully qualified chf file name that contains information about the h...

Страница 105: ... computer The parameters can contain wildcard characters 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 Table 3 67 boolean FileXferFromHost parameters Parameter Description HostFile as string Contains the fully qualified path and file name to be copied ...

Страница 106: ...d with executables For example it does not open Microsoft Word if you execute a doc file 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 iden...

Страница 107: ... 73 boolean ExecuteHostFile parameter Parameter Description FileName as string Contains the fully qualified path to the file on the host computer Table 3 74 boolean ExecuteHostFile return value Return value Description Boolean TRUE if command executed Table 3 75 BSTR GetError return value Return value Description String Returns the last error generated in Awrem32 Table 3 76 short ConnectionStatus ...

Страница 108: ...108 Visual C object definitions Awrem32 functions ...

Страница 109: ...ost device details 50 93 remote device details 31 79 connection types assigning 48 host properties 46 93 97 remote properties 28 79 82 unassigning 48 connections ending 64 105 connections continued returning errors 107 returning status 67 107 starting 43 63 76 104 country codes on host 100 on remote 83 CRemoteData using Visual Basic 26 using Visual C 77 CRemoteDataEx using Visual Basic 36 using Vi...

Страница 110: ...emote NetBIOS properties 34 81 O OLE Automation See pcAnywhere Automation Server P 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 R remote engine automatically registering 13 manually registering 14 remote objects creating 74 ...

Страница 111: ...Ex object 101 CHostDataManager object 86 code samples 85 103 CRemoteData object 77 CRemoteDataEx object 85 CRemoteDataManager object 71 importing classes 16 including Winawsvr h 17 W Winawsvr executable 14 header file 17 objects CHostData 44 92 CHostDataEx 55 101 CHostDataManager 39 86 CRemoteData 26 77 CRemoteDataEx 36 85 CRemoteDataManager 20 71 type library 16 ...

Страница 112: ...112 Index ...

Отзывы: