SchneiH2 Posted December 23, 2017 Report Posted December 23, 2017 Hi everybody I am about to transcribe a Gizmo64/Lua script into a plugin. Therefore, I had to start learning C++ where I believe made some good progress on the language itself, however, feel still weak with the whole environment (MS VS2017). So far I was working with the SDK2 and just started to try working with the SDK3. All code I have generated based on the SDK2 works well. including custom datarefs (instruction an examples mainly take from here http://www.xsquawkbox.net/xpsdk/mediawiki/Main_Page. As a basis I took the 'Hello World' example and copied i my code from SDK2. Except for the custom datarefs I can compil the project without errors. When adding the custom datarefs I get a compiler error as shown in the attached picture. Woul be great if somebody could provide some help. Thanks and regards SHJ Quote
PhM Posted December 26, 2017 Report Posted December 26, 2017 The function that you pass to XPLMUnregisterFlightLoopCallback must be the same as the one that was passed to XPLMRegisterFlightLoopCallback, here the compiler says that you are passing an XPLMDataRef instead of an XPLMFlightLoop_f. PhM Quote
SchneiH2 Posted December 29, 2017 Author Report Posted December 29, 2017 Hi PhM Thank your for your reply. There were basically two reasons for the problem (or maybe just one => ucritical copy/paste) The frst one is: XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterDataAccessor(SSJ100_APU_MSw); vs XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterFlightLoopCallback(SSJ100_APU_MSw); WRONG!!! => copy/paste issue The second one was uncorrect use of variable types (int vs float) in the accessor callbacks for the custom datarefs. Thank you again for your feedback and best regards SHJ Quote
Ben Russell Posted December 29, 2017 Report Posted December 29, 2017 1 minute ago, SchneiH2 said: Hi PhM Thank your for your reply. There were basically two reasons for the problem (or maybe just one => ucritical copy/paste) The frst one is: XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterDataAccessor(SSJ100_APU_MSw); vs XPLMUnregisterFlightLoopCallback(SysAPUFLCB, NULL); XPLMUnregisterFlightLoopCallback(SSJ100_APU_MSw); WRONG!!! => copy/paste issue The second one was uncorrect use of variable types (int vs float) in the accessor callbacks for the custom datarefs. Thank you again for your feedback and best regards SHJ Feel free to discuss your Gizmo stuff further via email if you'd like to. We might be able to work something out so you can avoid this pain. br@x-plugins.com Quote
SchneiH2 Posted December 29, 2017 Author Report Posted December 29, 2017 Hi Ben Thank you very much for your reply and offer. I hope not to disappoint you when saying that I got meanwhile very attracted by this pure programming stuff with the SDK and C++ and will continue this way although I guess that there are a lot of learning lessons ahead to go through. Never thought that I will somewhen start with C++ as it seemd to me very cryptic. Meanwhile, I got at least a first idea about the elegance of this programming language. I am quite optimistic that I will be able to transcribe the basic a/c functions from Gizmo/Lua quite fast, however, will probably get stuck with the 3D graphics stuff which I use for the EFB. Would be great if I could count on some help from you in future. Thank you again for your reply and all the best for 2018! Best regards SHJ Quote
Ben Russell Posted December 29, 2017 Report Posted December 29, 2017 2 minutes ago, SchneiH2 said: Hi Ben Thank you very much for your reply and offer. I hope not to disappoint you when saying that I got meanwhile very attracted by this pure programming stuff with the SDK and C++ and will continue this way although I guess that there are a lot of learning lessons ahead to go through. Never thought that I will somewhen start with C++ as it seemd to me very cryptic. Meanwhile, I got at least a first idea about the elegance of this programming language. I am quite optimistic that I will be able to transcribe the basic a/c functions from Gizmo/Lua quite fast, however, will probably get stuck with the 3D graphics stuff which I use for the EFB. Would be great if I could count on some help from you in future. Thank you again for your reply and all the best for 2018! Best regards SHJ I can appreciate that. I find a lot of enjoyment in using both, but I'm obviously biased. C/C++ can be great fun for the simpler things but appeasing the compiler and linker gods can be extremely frustrating sometimes even for experienced programmers. I'll help where I can.. Also highly recommend getting into some Arduino programming. Tangible programming and motion control is an even more addictive thing than PC tinkering... with a PC there can be infinitely deep complexity behind the button you click with the mouse but it's very difficult to appreciate. WIth an Arduino even the simplest of "sketches" can be appreciated because it can literally reach out and touch things. Enjoy! Quote
PhM Posted January 6, 2018 Report Posted January 6, 2018 On 29/12/2017 at 0:47 PM, Ben Russell said: ... Also highly recommend getting into some Arduino programming. ... I am also programming things with Arduinos as well as STM32 boards. If all you have ever done is programming on a PC then these will show you a complete new world where everything has to be carefully planned and thinked ahead. No more luxury, only the bare essentials to deal with. PhM 1 Quote
Ben Russell Posted January 8, 2018 Report Posted January 8, 2018 On 06/01/2018 at 7:05 AM, PhM said: I am also programming things with Arduinos as well as STM32 boards. If all you have ever done is programming on a PC then these will show you a complete new world where everything has to be carefully planned and thinked ahead. No more luxury, only the bare essentials to deal with. PhM I love how even small simple sketches can make huge differences to the physical world. Programming a PC project can be a thousand times more complex behind the screen but people just wont appreciate it 'cause it doesn't reach out and touch something. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.