❔ Connecting windows forms to console app

I have game written for console app and I need to add log system where each game can be saved as a text file and later loaded so I need to use window forms to open dialogs but I am not sure how to do it. I have made another project which is WindowForms and I want to open this window and give data from some method in my console app
12 Replies
Jack Badassson
Jack BadasssonOP2y ago
I am not even sure which one should be refrenced
Pobiega
Pobiega2y ago
a console app shouldnt be opening file dialogs, and is only possible with some pretty nasty hacks. Its much better you handle the saving via the console interface itself.
I have made another project which is WindowForms and I want to open this window and give data from some method in my console app
unclear what you are asking for here, can you rephrase?
Jack Badassson
Jack BadasssonOP2y ago
I have console app of where I keep adding string lines to a log, then I want to save this log so I want it to send it to windows form which would save it as a file using SaveFileDialog
Pobiega
Pobiega2y ago
cross-process communication isn't trivial, and for a thing like this I don't think its the right way to go how are the two processes related anyways? if the winforms app starts the console one, it could capture the output
Jack Badassson
Jack BadasssonOP2y ago
they arent related yet I tried to connect trough reference but it didnt work
Pobiega
Pobiega2y ago
no that just means one can use the code from the other doesnt give the processes the magical ability to communicate. honestly, it sounds like you should just "port" your console app into the winforms one? either embrace being a console app and disregard any GUI, or embrace being a GUI app and disregard the console this mix-and-match thing wont end well
Jack Badassson
Jack BadasssonOP2y ago
yeah it is probably what I will need to do
Pobiega
Pobiega2y ago
if you go with the console app, something like $spectre can really spice it up
MODiX
MODiX2y ago
Spectre.Console is a .NET library that allows for easy creation of console UIs, text formatting in the console, and command-line argument parsing. https://spectreconsole.net/
Spectre.Console - Welcome!
Spectre.Console is a .NET library that makes it easier to create beautiful console applications.
Jack Badassson
Jack BadasssonOP2y ago
it looks basic right now in console app but it is okay I just think how to put it all in windows worms now
SG97
SG972y ago
What does the winforms app do exactly
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server