[RESOLVED] when I call Pdk::Init(), many devices are NULL

srgriffiths
Posts: 36
Joined: Tue Aug 04, 2015 7:51 pm

[RESOLVED] when I call Pdk::Init(), many devices are NULL

Postby srgriffiths » Wed Nov 14, 2018 10:02 pm

when i call PdkServices::Init(pPdk) in DLLStart, many of the pdk services return null for some reason. Specifically

spWindowPluginSystem = PdkServices::GetWindowPluginSystem();
spPluginSystem = PdkServices::GetRenderingPluginSystem();

I need both of these services. Why would they be NULL?

Thanks,

Steve

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

Re: when I call Pdk::Init(), many devices are NULL

Postby BenBaron » Thu Nov 15, 2018 1:09 pm

Hi Steve,

I guess you'd need to show some more code, as I am able to get these two on my side. Just doing a quick and dirty:

Code: Select all

auto windowPluginSystem = PdkServices::GetWindowPluginSystem(); auto renderingPluginSystem = PdkServices::GetRenderingPluginSystem();
shows both of them populated.

Does PdkServices::GetPdk() also return a nullptr after your call to PdkServices::Init(pPdk)?

Greets, Benny

srgriffiths
Posts: 36
Joined: Tue Aug 04, 2015 7:51 pm

Re: when I call Pdk::Init(), many devices are NULL

Postby srgriffiths » Thu Nov 15, 2018 6:06 pm

Prepar3D version: 4.0.23.21468

Inside Init(pPdk) I see the following services are NULL

m_spVisualEffectManagner = NULL
m_spRenderingPluginSystem = NULL
m_spWindowPluginSystem = NULL
m_spGlobalData = NULL
m_spSimObjectManager = NULL
m_spIconService = NULL
m_spMenuService = NULL
m_spMultiplayerService = NULL

Everything else is valid.


extern "C" __declspec(dllexport) void __stdcall DLLStart(__in __notnull IPdk* pPdk)
{
PdkServices::Init(pPdk);

auto spWindowPluginSystem = PdkServices::GetWindowPluginSystem();
if (!spWindowPluginSystem)
{
printf("No WindowPluginSystem. Major Problem!");
}

auto spRenderingPluginSystem = PdkServices::GetRenderingPluginSystem();
if (!spRenderingPluginSystem)
{
printf("No RenderingPluginSystem. Major Problem!");
}

s_pSystemReadyCallback = new SystemReadyCallback();
PdkServices::GetEventService()->RegisterCallback(EVENTID_Message, s_pSystemReadyCallback);
}


Thanks in advance for any suggestions!

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

Re: when I call Pdk::Init(), many devices are NULL

Postby BenBaron » Thu Nov 15, 2018 7:07 pm

Hi Steve,

just a quick one, but the most recent version is Prepar3D 4.3.29.25520 for core and the SDK. With this one I am getting those services, so maybe it has something to do with you not getting them.

Any reason, why you didn't upgrade, yet?

Greets, Benny

srgriffiths
Posts: 36
Joined: Tue Aug 04, 2015 7:51 pm

Re: when I call Pdk::Init(), many devices are NULL

Postby srgriffiths » Thu Nov 15, 2018 8:09 pm

You're right! I did install the latest, but for some reason, I had to uninstall the old version and then reinstall the new version. Now I get valid pdk services.

Thanks for noticing that!


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 5 guests