New project - MSFS C++ USB interface


+ Reply to Thread
Results 1 to 40 of 170

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Thanks. Yup, tried C For Dummies 20+ years ago and got nowhere fast.

    I'll refer you one youtube video later. The dude speaks clearly, and in no time you have a basic window with buttons and stuff.

    Best part, Visual Studio 2022 Community is free. It's way better than what we had for Visual Basic way back when.
    Last edited by Demon; - 22nd May 2023 at 00:08.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    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.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Thanks for the link.

    Ioannis

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    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.

    Name:  Engine RPM read.png
Views: 23480
Size:  432.8 KB

    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

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    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.

    Name:  Engine RPM read into DBL.png
Views: 23439
Size:  328.8 KB

    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."

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    WOOT!

    It helps when you know what questions to ask google, AND you get very well-explained pages.

    Name:  Engine RPM displayed in TextBox.png
Views: 23398
Size:  370.4 KB

    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 01:06.

  7. #7
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    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.

Similar Threads

  1. USB interface
    By Frozen001 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th December 2011, 19:37
  2. Host for USB interface?
    By Carrasco in forum Off Topic
    Replies: 4
    Last Post: - 3rd August 2007, 23:59
  3. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  4. USB interface from PIC16F877 to PC
    By headshouter in forum USB
    Replies: 0
    Last Post: - 26th February 2006, 04:58
  5. USB project
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 18th January 2005, 21:59

Members who have read this thread : 11

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts