I have an application which uses C# for front end and C++ DLL for the logic part. I would want to print error messages on console screen from my C++ DLL even when the C# GUI is present. Please let me know how to do this.
Thanks, Rakesh.
You can use AllocConsole() to create a console window and then write to standard output.
If you are using C or C++ standard I/O functions (as opposed to direct win32 calls), there are some extra steps you need to take to associate the new console with the C/C++ standard library's idea of standard output. http://www.halcyon.com/~ast/dload/guicon.htm explains what you have to do and why, with complete code.
You can use OutputDebugString in C++ DLL, and then execute DebugView to get the messages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With