Page 1 of 1

How to get IDISManagerV450 in C# application.

Posted: Sat May 02, 2020 6:51 am
by sunilhalvi
Hi all,
I am working on a C# project which has progressed significantly.
I need to retrieve DIS related data from simconnect such as entity Id, site Id e.t.c. I read a discussion in this forum which mentioned IDISManagerV450 to get DIS related data. How can I call APIs implemented in IDISManagerV450 from a C# project?

Re: How to get IDISManagerV450 in C# application.

Posted: Sat May 02, 2020 3:18 pm
by Brady Butler
Hello sunilhalvi,

There's no built-in way to do access this data in C# from the SDK. There are a few options where you can create wrappers around a C++ API and convert it either into .NET types or C-style functions to access it in C#.

Regards,
Brady

Re: How to get IDISManagerV450 in C# application.

Posted: Sun May 03, 2020 3:15 pm
by sunilhalvi
Hi Brady Butler,
Thank you for your reply, I am working on creating a c++ dynamic library just for calling GetEntityIdByObjectId().
For achieving that I'm going through the Prepar3D website which explains working with PDK, there it is mentioned that "To register your SimObject class, you must first obtain a reference to the Prepar3D Developer Kit interface."
In c++ PDK sample project reference to the P3D developer Kit interface is obtained through parameters of DLLStart() function. In my case, I don't want my library to be called by prepar3D, so I don't have DLLStart() in my library. How can I get reference to the P3D developer kit Interface?

Re: How to get IDISManagerV450 in C# application.

Posted: Tue May 05, 2020 5:47 pm
by Brady Butler
Hello sunilhalvi,

I'm not sure that I understand what you're asking, but it sounds like you may be looking for something like SimConnect to manipulate/read the data from the simobjects instead of the PDK.

Regards,
Brady

Re: How to get IDISManagerV450 in C# application.

Posted: Tue May 05, 2020 6:19 pm
by sunilhalvi
My primary aim is to obtain DIS IDs like entity ID, site ID, exercise ID e.t.c in a c# project which is already using simconnect.dll. As I didn't find any help from simconnect.dll, I started focusing on IDISManagerV450, which is a c++ interface class. So now, I want to create a c++ dll which will call getentityIDbyObjectID() API, which is defined in IDISManagerV450. My C# project will use c++ dll to obtain DIS IDs.
What I'm asking for is:- How to get the reference to the P3D developer Kit interface(the IPdk), which sample codes get through parameters of DLLStart() function. (STDMETHODIMP_(void) DLLStart(__in __notnull IPdk* pPdk))