Data Sheet

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite
27
2.1.12 IUsbAnalyzer::get_ApplicationFolder (property)
HRESULT get_ApplicationFolder( [out, retval] BSTR *app_folder );
Retrieves the full local path to the folder where the USB Protocol Suite application was installed and
registered as a COM server.
Parameters
app_folder Pointer to string variable indicating USB Protocol Suite application folder
Return values
Remarks
This property allows client applications to access some important files used by the USB Protocol Suite
application, such as recording options, display options, and trace files, in places relative to the USB
Protocol Suite application folder. If later the USB Protocol Suite application is re-installed to another
location, the client code does not have to be changed to reflect this event.
Example
WSH:
Set Analyzer = WScript.CreateObject("CATC.UsbTracer")
' Open trace file 'some_trace.usb' in the USB Suite folder.
Set Trace = Analyzer.OpenFile( Analyzer.ApplicationFolder & "some_trace.usb" )
' Save opened trace as 'some_trace1.usb' in the USB Suite folder.
Trace.Save Analyzer.ApplicationFolder & "some_trace1.usb"
...
C++:
HRESULT hr;
IUsbAnalyzer* poUsbAnalyzer;
// Create UsbAnalyzer object.
if ( FAILED( CoCreateInstance( CLSID_UsbAdvisor, NULL, CLSCTX_SERVER,
IID_IUsbAnalyzer, (LPVOID *)&poUsbAnalyzer ) )
return;
BSTR app_folder;
hr = poUsbAnalyzer->get_ApplicationFolder( &app_folder );
// . . . Do something with app_folder.
SysFreeString( app_folder ); // Free BSTR resources.
poUsbAnalyzer->Release(); // Release analyzer object.