Jump to content

Recommended Posts

Posted

I'll just jump in and post something since you're doubling up questions without getting answers... this is way too broad of a request for one post to answer. Definitely a lot to ask for. I also wouldn't be surprised if they want to restrict the capabilities and function of the dll authoring tools to those under NDA. Just a couple considerations! :)

Posted

That would be great, if they could just send us one.... :D

 

The question is not too broad - there is a minimum number of calls we need to make, and no doubt a few functions the sim expects to see.... what are they??

 

Until we have this info, we are grounded. :(

 

Best regards,

Tango.

  • ED Team
Posted

Easy guys !

not so much at this moment

 


typedef int   (*PF_DCS_PLUGIN_INITIALIZE)   (void);
typedef int   (*PF_DCS_PLUGIN_RELEASE)      (void);
typedef void* (*PF_DCS_PLUGIN_GET_INTERFACE)(void);
//called after library loaded 
binary->pfn_initialize		   = (PF_DCS_PLUGIN_INITIALIZE)dlsym(binary->ibrary_handle,"initialize");
binary->pfn_get_interface	   = (PF_DCS_PLUGIN_GET_INTERFACE)	dlsym(binary->library_handle,"get_interface");
//called before unloading
binary->pfn_release			   = (PF_DCS_PLUGIN_RELEASE)		dlsym(binary->library_handle,"release");

 

planned to add support ASAP for:


double  update(double time);//will be called by model timer at "time" , return value is next --time when this callback should be called 

//call before render frame 
int  before_frame();
//call after
int  after_frame();

 

Any suggestions of what type feature you need you can post here

sigpic2354_5.gif
Posted

Thanks Alex!

i7 7700K | 32GB RAM | GTX 1080Ti | Rift CV1 | TM Warthog | Win 10

 

"There will always be people with a false sense of entitlement.

You can want it, you can ask for it, but you don't automatically deserve it. "

Posted (edited)

Hi Alex,

 

Thank you for the reply.

 

In your first code example, it appears you are setting pointers to the functions pfn_initialize, pfn_get_interface and pfn_release.

 

Is pfn_get_interface a callback that is the entry point for ALL functions of the system? e.g. the model will reference certain things, and the code will call this function with some parameter from the model? We need more information on how to implement the function.

 

I'm confused as to why you want to know which features we want adding, when we can't even get started with a basic DLL that works with DCS??

 

Best regards,

Tango.

Edited by Tango
Posted

Hi Alex,

 

What we would like is this. A small, complete, working DLL code example that does nothing but handle the landing gear lever of the cockpit. This is implemented in some form in every aircraft in DCS.

 

What we need is the interface between the model, sim and our code.

 

We need to see what happens when the user clicks a switch in the cockpit, what call(s) are made back to our code?

 

When our code does something, how do we write back to the sim (e.g. switch on the green gear down indicator light in the cockpit?).

 

This is the information we require. Once we know how to interact with the sim, we can ask more specific questions and provide more specific feedback to you. :)

 

Best regards,

Tango.

  • Like 1
Posted (edited)

Is the following valid for DCS??

 

#include "stdafx.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                      DWORD  ul_reason_for_call,
                      LPVOID lpReserved
                    )
{
   switch (ul_reason_for_call)
   {
   case DLL_PROCESS_ATTACH:
   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
       break;
   }
   return TRUE;
}

__declspec(dllexport) int __cdecl initialize(void);
__declspec(dllexport) int __cdecl release(void);
__declspec(dllexport) void __cdecl get_interface(void);

int initialize(void)
{
   return 0;
}

int release(void)
{
   return 0;
}

void get_interface(void)
{
   return;
}

Best regards,

Tango.

Edited by Tango
  • ED Team
Posted
Is the following valid for DCS??

 

#include "stdafx.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                      DWORD  ul_reason_for_call,
                      LPVOID lpReserved
                    )
{
   switch (ul_reason_for_call)
   {
   case DLL_PROCESS_ATTACH:
   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
       break;
   }
   return TRUE;
}

__declspec(dllexport) int __cdecl initialize(void);
__declspec(dllexport) int __cdecl release(void);
__declspec(dllexport) void __cdecl get_interface(void);

int initialize(void)
{
   return 0;
}

int release(void)
{
   return 0;
}

void get_interface(void)
{
   return;
}

Best regards,

Tango.

 

should be something like that

__declspec(dllexport) void*  __cdecl get_interface(void);
void * get_interface(void)
{
   static MyInterface object;


   return &object;
}

sigpic2354_5.gif
Posted

OK.... so what needs to be in "MyInterface"?

 

Can you post a complete example? It would be much easier. :)

 

Best regards,

Tango.

  • 2 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...