3 ianalyzeradapter::detach, Ianalyzeradapter::detach – Teledyne LeCroy USB Analyzer Automation Manual User Manual

Page 127

Advertising
background image

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite

127

10.1.3 IAnalyzerAdapter::Detach

HRESULT Detach();


This method detaches the CATC Analyzer object from the adapter.

Parameters


Return values


Remarks

This method detaches an Analyzer object from the adapter. This method does not guarantee

that all resources associated with the detached object are freed. All existing pointers to that object
should be released to destroy the remote object.

Example

VBScript:

</HEAD>
<OBJECT id=AnalyzerAdapter

classid=clsid:A0CB5386-38BA-4970-8782-3D1B707C3E5F>

</OBJECT>
...
<input type="button" value="Connect" name="BtnConnect">
<input type="button" value="Disconnect" name="BtnDisconnect">
<INPUT NAME="RemoteServer">

<SCRIPT LANGUAGE="VBScript">
<!--
Sub BtnConnect_onclick

On Error Resume Next


Set Analyzer = AnalyzerAdapter.CreateObject("CATC.USBTracer", RemoteServer.value)


if Not Analyzer Is Nothing Then

window.status = "USBTracer connected"

else

msg = "Unable to connect to USBTracer"

MsgBox msg, vbCritical

window.status = msg

End If

End Sub

Sub BtnDisconnect_OnClick

AnalyzerAdapter.Detach ' Detach the analyzer object from adapter.
Set Analyzer = Nothing
' Release the pointer to the analyzer returned by CreateOject().


window.status = "USBTracer disconnected"

End Sub
-->
</SCRIPT>

Advertising