Tango Posted May 26, 2012 Posted May 26, 2012 Hi Alex, How do we create our own DLLs containing the systems programming?? Best regards, Tango.
Tango Posted May 27, 2012 Author Posted May 27, 2012 Which functions do we need to call, and which exports do we need to create? Best regards, Tango.
aaron886 Posted May 27, 2012 Posted May 27, 2012 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! :)
Tango Posted May 27, 2012 Author Posted May 27, 2012 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 Alex Okean Posted May 30, 2012 ED Team Posted May 30, 2012 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
Blaze Posted May 31, 2012 Posted May 31, 2012 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. "
Tango Posted May 31, 2012 Author Posted May 31, 2012 (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 May 31, 2012 by Tango
Tango Posted May 31, 2012 Author Posted May 31, 2012 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. 1
Tango Posted May 31, 2012 Author Posted May 31, 2012 (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 May 31, 2012 by Tango
ED Team Alex Okean Posted May 31, 2012 ED Team Posted May 31, 2012 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; }
Tango Posted May 31, 2012 Author Posted May 31, 2012 OK.... so what needs to be in "MyInterface"? Can you post a complete example? It would be much easier. :) Best regards, Tango.
aaron886 Posted June 2, 2012 Posted June 2, 2012 (edited) Patience, sir, patience! :) Good thread thus far! Edited June 2, 2012 by aaron886 sp
DArt Posted August 23, 2012 Posted August 23, 2012 OK.... so what needs to be in "MyInterface"? Can you post a complete example? It would be much easier. :) Best regards, Tango. I am agree, an example is welcome...:helpsmilie: [ https://www.lotatc.com ]
Recommended Posts