Partager via


ILogicalSensorManager::Disconnect method

[ILogicalSensorManager::Disconnect is no longer available for use as of Windows 8.]

Disconnects the specified logical sensor.

Syntax

HRESULT Disconnect(
  [in] REFGUID logicalID
);

Parameters

  • logicalID [in]
    REFGUID that identifies the logical sensor to disconnect.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Calling ILogicalSensorManager::Uninstall for a particular sensor after calling this method will cause an error.

Examples

The following example code creates a helper function that disconnects from a logical sensor.

HRESULT DisconnectFromLogicalSensor(GUID guidLogicalID)
{
    HRESULT hr = S_OK;

    ILogicalSensorManager* pLSM = NULL;
 
    if(SUCCEEDED(hr))
    {
        // Create the logical sensor manager.
        hr = CoCreateInstance(CLSID_LogicalSensorManager, 
                                NULL, 
                                CLSCTX_INPROC_SERVER, 
                                IID_PPV_ARGS(&pLSM));
    }

    if(SUCCEEDED(hr))
    {
        hr = pLSM->Disconnect(guidLogicalID);
    }

    SafeRelease(&pLSM);

    return hr;
}

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

None supported

End of client support

Windows 7

Header

Sensorsapi.h

Library

Sensorsapi.lib

DLL

Sensorsapi.dll

See also

About Logical Sensors

ILogicalSensorManager

Using Logical Sensors