[RESOLVED] Query the PDK for ISurfaceQueryManagerV400

BenBaron
Posts: 79
Joined: Fri Jan 16, 2015 7:51 am

[RESOLVED] Query the PDK for ISurfaceQueryManagerV400

Postby BenBaron » Sun Nov 18, 2018 11:17 am

Hi all,

although I've already touched briefly on this subject in another thread, I thought it might be best to start a new one for this, specifically.

Is anyone able to get the above mentioned service? The SDK reads "General surface queries, not associated with a specific object. This service interface is available from the PDK. Inherits IUnknown." I tried to query for it doing it like this:

Code: Select all

CComPtr<ISurfaceQueryManagerV400> surfaceQueryManager; PdkServices::GetPdk()->QueryInterface(IID_ISurfaceQueryManagerV400, (void**)&surfaceQueryManager);
but all I get is a HRESULT of E_NOINTERFACE and a nullptr surfaceQueryManager.

Would someone of the devs be so kind to shed a light on this, or can someone else try if they are able to get this interface?

Otherwise, I would need to additionally implement SimConnect to query for the surface elevation without a SimObject in place, but I'd rather not want to do this, if it wasn't strictly necessary.

So, any help is highly appreciated.

All the best, Benny

Mike Schroeter
Lockheed Martin
Posts: 317
Joined: Thu Jan 12, 2012 7:05 pm

Re: Query the PDK for ISurfaceQueryManagerV400

Postby Mike Schroeter » Tue Nov 20, 2018 7:12 pm

You're close, but you need to use QueryService rather than QueryInterface, e.g.:

Code: Select all

CComPtr<ISurfaceQueryManagerV400> surfaceQueryManager;

Code: Select all

PdkServices::GetPdk()->QueryService(SID_SurfaceQueryManager, IID_ISurfaceQueryManagerV400, (void**)&surfaceQueryManager);
QueryInterface asks the object (PDK in your case) to return itself with a specified IID. QueryService asks the object if it can provide a specified service with a specified interface.

Hope this helps,
Mike

BenBaron
Posts: 79
Joined: Fri Jan 16, 2015 7:51 am

Re: Query the PDK for ISurfaceQueryManagerV400

Postby BenBaron » Wed Nov 21, 2018 8:54 am

Thanks very much, Mike, for clarifying this.

Now, I really get the purposes of QueryInterface and QueryService and their respective parameter lists.

And, as expected, it now works like a charm.

All the best to you,

Benny


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 17 guests