Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to return value from C++ main application to C# GUI application?

I would like to know how to do this? For example, if exception occurs in C++ main application, how do send something to the GUI application? Any simple example would be appreciated.

like image 717
taker Avatar asked Nov 26 '25 15:11

taker


1 Answers

If the C# GUI app starts the C++ console app, then the exit code of the latter (the return value of the main() function) can be accessed by the former, see the example here: Process.ExitCode. The general solution is to use some form of InterProcess Communication (IPC). Windows examples: here and here.

like image 161
kol Avatar answered Nov 29 '25 04:11

kol



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!