Here, download and install VS2022 Community. It's free.
Then follow his instructions to the letter. You have a simple Windows form in no time.
Here, download and install VS2022 Community. It's free.
Then follow his instructions to the letter. You have a simple Windows form in no time.
It's so frustrating. "Experts" on forums assume you know C++ nearly as much as they do, or point to sample code that is exactly like what you've already put together, or say "hey, just use this conversion routine" - except that routine doesn't work against that sort of variable.
I'm so close, I can see the data in the structure and it matches what's displayed on the instrument panel. I guess I'm off to "C++ structure tutorials" in hope of finding something useful.
Robert
![]()
Argh, it's like extracting teeth; slow and painful. Thanks to google I was able to "address" the structure element properly and copy it into a double variable.
I may have got just a tad smarter by learning this, but I just moved the problem into another pile; I can't seem to be able to do anything with a double variable. Can't display it on screen, can't convert it to a string; I tried but commented out the attempts to keep track of what I did.
Robert
"At least I'm not going backwards."
WOOT!
It helps when you know what questions to ask google, AND you get very well-explained pages.
Now I have to return that value to the PIC, but in the meantime, I'm getting a beer.
Robert
EDIT: Hmmm, maybe I don't deserve that beer yet. There's a 15 second lag before throttle changes are reflected in my app. I'm hoping it's because I used "option 2" on how you can poll SimConnect for variables; it also contains the USB code (not sure yet if that can impact the SimConnect logic).
Really hoping "option 1" works as promised by the Devs (it's a callback routine, not my type of code, but hey, if it works as promised).
Last edited by Demon; - 23rd May 2023 at 02:06.
About 7 years ago I decided to get serious about Visual Basic (as opposed to C++) and bought 5 different books on the subject. I'm an old fart (56) and still like paper books. At any rate, about 90% of what I need to know is somewhere in at least 1 of those books. Occasionally I have to jump on YouTube for answers, but the books really helped me. Just sharing my experience.
Yup, we should be able to find an answer to a question on just about any software issue today. Oddly, I'm starting to notice a trend of websites posting "relevant information" without going into the exact answer. I'm starting to think that web traffic (money for ads) is starting to dilute our source of information. And then the forums of egos arguing with each other, and not one of them give a complete code answer to the original question. It's taking a surprising amount of times on some issues; like the sheer volume of C# links popping up for C++ searches; driving me bananas.
I had a serious lag issue with my USB generated code when I'd read variables from the MSFS SDK. So I started a new program from scratch, no USB, made just to read the Engine RPM and nothing else. Then I compared it with SimVar Watcher; it's the tool distributed along with the SDK to doublecheck our work. Turns out I had to add a delay feature to run beside SVW at full speed (I got extra practice on string manipulations and tweaking a Timer on the fly, so not a waste of time).
This is with a 1ms delay timer on my program during max acceleration:
I had to slow down to 5ms to be right at the same speed as SVW also during max accel:
So I'm happy. At least I know that now I can run at an acceptable rate of speed. I have a theory why my code bogged down before, need to do another test.
Robert
![]()
Last edited by Demon; - 24th May 2023 at 03:47.
Bookmarks