❔ 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
I am not even sure which one should be refrenced
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 appunclear what you are asking for here, can you rephrase?
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
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
they arent related yet
I tried to connect trough reference but it didnt work
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
yeah it is probably what I will need to do
if you go with the console app, something like $spectre can really spice it up
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.
it looks basic right now in console app but it is okay
I just think how to put it all in windows worms now
What does the winforms app do exactly
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.