Export (0) Print
Expand All

ILocation::SetReportInterval method

Specifies the requested minimum amount of time, in milliseconds, between report events.

Syntax


HRESULT SetReportInterval(
  [in]  REFIID reportType,
  [in]  DWORD millisecondsRequested
);

Parameters

reportType [in]

REFIID that specifies the report type for which to set the interval.

millisecondsRequested [in]

DWORD that contains the report interval value, in milliseconds. If this value is zero, no minimum interval is specified and your application receives events at the location sensor's default interval.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

HRESULT_FROM_WIN32(ERROR_INVALID_STATE)

The caller is not registered to receive events for the specified report type.

HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)

reportType was other than IID_ILatLongReport or IID_ICivicAddressReport.

 

Remarks

The interval you request by using this method represents the shortest amount of time between events. This means that you request to receive event notifications no more frequently than specified, but the elapsed time may be significantly longer. Use this method to help ensure that event notifications do not use more processor resources than necessary.

It is not guaranteed that your request for a particular report interval will be set by the location provider. Call GetReportInterval to discover the true report interval setting.

A report interval of zero means that no minimum interval is specified, and the application may receive events at the frequency that the location sensor sends events.

Examples

The following example demonstrates how to call SetReportInterval.



// Set the latitude/longitude report interval to 1000 milliseconds
HRESULT hr = spLocation->SetReportInterval(IID_ILatLongReport, 1000);

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

None supported

Client

Windows 7

Header

LocationApi.h

DLL

LocationAPI.dll

See also

ILocation

 

 

Community Additions

ADD
Show:
© 2014 Microsoft