How do I include GDI into a console program? None of these work:
#include <gdi.h>
#include <gdi32.h>
How do I include GDI into a console program? None of these work:
#include <gdi.h>
#include <gdi32.h>
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
I did create a window using CreateWindowA. I need to include GDI for it to work. It gets automatically included in a Window program, but not a console program, so I need to know what to include.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
If you want to add GDI into a console application then once you have created the window using CreateWindow() you should be able use the GDI functions e.g. GetDC() etc, inputting the handle of the window you created as a parameter. Ofcourse, if you are adding the window to a console application you may need to add in a bit of coding if you want a message loop structure as is typical for most windows programs.
Rats!!! Sebastiani you beat me to it :P lol
I don't know what that means.You may also need to pass the GDI DLL information to the linker, depending on how your compiler is set up.
I get this error:
On this line:Release Win32\Drivers\Window\Windows\WindowsWindowDriver.o :WindowsWindowDriver.cpp.text+0x194): undefined reference to `GetStockObject@4'
I am using Code::Blocks with the GCC compiler.Code:wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH );
Last edited by JMK; 09-01-2010 at 01:50 PM.
I opened BUild Options, and in Link Libraries I just added this line:
libgdi32.a
And it worked!
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }