I am working with code blocks using MinGW, and I have a coding project I've been working on for some time. The project I've been using has been console application, and the debug functions I have rely on printing to the console.
However, recently, I've tried to implement windows 'GetOpenFileName()' function to pull up an open file box so it'd be a lot easier for users to open files with. However, when using a project in console application with the headers included, the MinGW compiler acts like it can't find the function. I found however changing the project to win32 GUI allows the compiler to find the function (I don't entirely understand why but that's just me).
The problem is thus: I tried to output debug information to console, but of course now the application is win32 GUI, the console doesn't display and thus I cannot see the debug information, and I can't switch it back to console application or the windows open file box code won't compile. How do I both display the console and still allow the project to correctly compile the windows GUI code?
I cannot alter the debug functions or use different ones because they are written into all of the classes to assist with back-tracing errors and there are at least 43 files, most of which use the debug functionality.
<windows.h>in a console application should still work. If you absolutely need a console and can't have one, though, there'sAllocConsole.comdlg32.lib.