IDefaultLocation::GetReport method (locationapi.h)

[The Win32 Location API is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use the Windows.Devices.Geolocation API. ]

Retrieves the specified report type from the default location provider.


HRESULT GetReport(
  [in]  REFIID          reportType,
  [out] ILocationReport **ppLocationReport


[in] reportType

REFIID representing the interface ID for the type of report being retrieved.

[out] ppLocationReport

The address of a pointer to ILocationReport that receives the specified location report from the default location provider.

Return value

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

Return code Description
The location report was successfully retrieved.
reportType is other than IID_ILatLongReport or IID_ICivicAddressReport.
No data is available. This may be due to a lack of default location data in the registry, corrupt data in the registry, or a missing Country/Region field in the default location report.
ppLocationReport is NULL.


ILocationReport is the base interface for specific location report types. The actual interface you use for ppLocationReport must match the type you specified through reportType.

A call to IDefaultLocation::GetReport may result in a notification being displayed in the taskbar, and a Location Activity event being logged in Event Viewer, if it is the application's first use of location.


Minimum supported client Windows 7 [desktop apps only],Windows 7
Minimum supported server None supported
Target Platform Windows
Header locationapi.h
DLL LocationAPI.dll

See also

About Location Notifications

About Logging Location Activity