'These members represent the main TestType object properties. Public RemoteAgentCLSID AsString' Run Remote Agent Class ID Public ScriptViewerCLSID AsString' ActiveX script viewer Class ID Public TestingToolName AsString' Remote Agent name Public ExecConfigCLSID AsString' Configuration Class ID Public LastErrorMessage AsString' Most common error message Public ResultViewerCLSID AsString' ActiveX result viewer Class ID
' '******************************************************************* PrivateSub Class_Initialize() 'This sub-routine is run when the TestType is loaded. 'Note that at this time, none of the optional controls is ' supported, as their class ID strings are empty. 'Also note that the remote agent class ID is empty, ' as no such agent yet exists. 'This example does not support script templates, ' and has only one error type.
ExecConfigCLSID = ""' No configuration utility provided RemoteAgentCLSID = "[Class ID for the Run Remote Agent]" ScriptViewerCLSID = "[Class ID for ActiveX script viewer]" TestingToolName = "Script" LastErrorMessage = ""' Testing issues ResultViewerCLSID = ""' No result viewer ActiveX provided LoadPicture "" EndSub
PublicSub Init(mytd AsVariant) ' You may need a TDConnection to use OTA functions in your application. ' If you do, add a project reference to the OTA: ' In Projects > References, check the "OTA COM 8.0 Type Library." ' and declare a module-level variable: Private td As TDConnection Set td = mytd 'Get the td object to be used if needed EndSub
PublicFunction CreateScriptTemplate(TestKey AsLong, _ ByRef LocalPath AsString) AsLong ' Create a batch file to emulate a test script for ' this example Dim myf AsString LocalPath = "c:\temp" myf = "C:\temp\batch.bat" Open myf For Output As #1 Print #1, "ping localhost" & vbCrLf & "pause"'create script template Close #1 CreateScriptTemplate = 1 EndFunction