-1

I have created a program that extracts data from a racing game and sends it to a speed gauge cluster. I call it the transfer program.

I need a simple user-friendly User Interface to start the transfer program, set some variables and choose a COM Port. At the moment I'm trying to do it with a C++ Windows Forms Application in a CLR Project on Microsoft Visual Studio 2015. When I tried to do it directly (creating the UI in the same project as the transfer program) I just get too many errors that I have no idea where they come from or why they are there.

So I've decided maybe I could try creating some sort of launcher, i.e. a completely different program that is only the UI to start the transfer program and send a few user-set variables to it on startup as well as choose a COM Port to communicate on.

Any idea on how to start on this? How do I execute the transfer program from the Launcher? How do I send variables and data to it?

Thank you very much!

Frazic
  • 77
  • 9

1 Answers1

0

There are basically two ways to pass information to your transfer program.

  1. For simple use cases, just pass the values along on the command line. If you're still using the CLR, this is done using System.Diagnostics.Process. A nice example can be found in this answer: https://stackoverflow.com/a/33633148/127826
  2. Use a shared configuration file. So the user interface loads the values from the config and also saves the file before executing the transfer program. The transfer program then reads the same configuration file to get the values it needs.

The second approach is far more flexible and is what I would use.

Community
  • 1
  • 1
Cobus Kruger
  • 8,338
  • 3
  • 61
  • 106