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
[RESOLVED] when I call Pdk::Init(), many devices are NULL
-
- Posts: 36
- Joined: Tue Aug 04, 2015 7:51 pm
Re: when I call Pdk::Init(), many devices are NULL
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:
shows both of them populated.
Does PdkServices::GetPdk() also return a nullptr after your call to PdkServices::Init(pPdk)?
Greets, Benny
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();
Does PdkServices::GetPdk() also return a nullptr after your call to PdkServices::Init(pPdk)?
Greets, Benny
-
- Posts: 36
- Joined: Tue Aug 04, 2015 7:51 pm
Re: when I call Pdk::Init(), many devices are NULL
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!
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!
Re: when I call Pdk::Init(), many devices are NULL
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
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
-
- Posts: 36
- Joined: Tue Aug 04, 2015 7:51 pm
Re: when I call Pdk::Init(), many devices are NULL
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!
Thanks for noticing that!
Return to “Software Development Kit (SDK) Questions”
Who is online
Users browsing this forum: No registered users and 14 guests