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,172


    Did you find this post helpful? Yes | No

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

    Step 1, made 2 identical programs in 32 and 64 bits, that turn the light ON/OFF only on their side.

    Name:  IPC x86 and x64.png
Views: 31446
Size:  7.4 KB


    Step 2, get them to turn ON/OFF both sides.

    ... insert cool pic here on soonday ...

    Robert

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


    Did you find this post helpful? Yes | No

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

    Wow, talk about a roller-coaster (memory getting fuzzy now about exact sequence):

    - back in early 2023, I get a basic C++ WinForm GUI running with MSFS SDK, not even knowing what type of program I create (from youtube video).

    - decide on upgrading to HIDmaker FS2 to generate PIC and C++ USB code.

    - generate USB C++ code, I chose C++ MFC cause I recently saw that in the MSFS SDK docs, compile in x86 ok.

    - compile in x64, cause I just saw that again in the MSFS SDK docs, compile failed!

    - google migrating C++ x86 to x64, looks like the apocalypse to me.

    - figure I'll make a x64 program between the x86 C++ code and the MSFS SDK code.

    - start googling, quickly narrow in on Inter Process Communication.- eventually IPC Shared Memory between x86 and x64 stands above the crowd.

    - turns out the BOOST group have been working on that, some programmers report success, but never sharing a complete sample.

    - I try it using the sample from Boost.org, fail miserably, so I made a rather lengthy post on Stack Overflow asking for help.

    - as backup, I find out Adontec produces exactly what I need, just for $400USD, sent then a message to confirm it'll work under my criteria.

    - as I'm reviewing the MSFS SDK docs, I notice they say x64 MFC app if you're interfacing "directly" with MSFS, but you can use an ordinary console app if you don't.

    - Nothing to lose, so I switch back to C++ Winform, turns out I'm not, I'm just playing with a DLL.

    - generate the C++ x86, then compile using x64, and BOOM! The darn thing compiled.


    So yeah, been an up-and-down last few days. Hopefully things keep going my way.

    Robert


    "just a blind man running with a huge smile on his face!"
    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!

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


    Did you find this post helpful? Yes | No

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

    Seems you are very persistent person! And wow, you did an amazing trip through all these environments...!

    Respect from me.

    Ioannis

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


    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

    I prefer the term "obnoxiously stubborn and willfully oblivious".

    Note to future-self, ALWAYS put the Windows INCLUDE at the top of the list. Argh, the multitude of insane errors and hours of google searches...


    Status of the day; didn't get as far as I planned with that stupid include problem, but I did get to compile the generated code with USB components in 64-bits, and connect to MSFS, that last part was my do-or-die moment of the day.

    Name:  Connected to FS with USB code.png
Views: 30332
Size:  717.1 KB

    EDIT: Oh yeah, the single button in the interface works fine; changing between a 0 and a 1 when I press a button on the Lab-X1. Haven't implemented anything else yet.
    Last edited by Demon; - 19th May 2023 at 23:17.

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


    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

    Men can find joy from the simplest things.

    Landing light ON-OFF from the Lab-X1 via USB.

    Name:  Landing light ON-OFF from Lab-X1.png
Views: 24052
Size:  447.8 KB

    Robert

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,172


    Did you find this post helpful? Yes | No

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

    Quote Originally Posted by Demon View Post
    Men can find joy from the simplest things.

    Landing light ON-OFF from the Lab-X1 via USB.
    Oh, yeah! I understand that feeling... Especially after the long trip to finally manage that damn thing to flip!

    Ioannis

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

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

    YAY! I can finally detect a change in Engine RPM. And this is why I absolutely wanted to have Code Debugging working.

    Name:  Engine RPM change detected.png
Views: 30049
Size:  498.7 KB

    Now I just have to learn how to use structures and variables in C++. I kept trying to peek at that data, but I just couldn't get to see anything meaningful.

    Good thing we have google tutorials. Worse case, I'll ask on the Dev forums, but I want to try to get there on my own.

    Robert

Similar Threads

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

Members who have read this thread : 7

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