Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Bitmap - Wingdi.h

Hi all !

I am developing on VC++ v6 and using ALLEGRO for input output of my communication sofware.
I get the error massage "c:\program files\microsoft visual studio\vc98\include\wingdi.h(486) : error C2371: 'BITMAP' : redefinition; different basic types", while I compile the:

void conalleg_c::set_bitmap(BITMAP *b, int x, int y, int w, int h, int border) {

bmp = b;
if (bmp) {

this->set_draw_pos(x,y,w,h,border);

// *** CHANGE THIS TO ANY COLORS YOU LIKE BETTER ***
bcol = makecol(50,50,50); //makecol(R,G,B) = Allegro color maker function..
tcol = makecol(255,255,255);
pcol = makecol(0,255,0);

text_mode(-1); //Allegro

this->draw_page(true); //console_c method
}
else
this->disable_display(); //console_c method
}

anyone can help ?
[894 byte] By [nivrobin] at [2007-11-11 10:11:26]
# 1 Re: Bitmap - Wingdi.h
Make sure you don't include header files more than once so you better use some protection like seen below:

// YourHeader.h
#if !defined( YOUR_HEADER_FILE_INCLUDED )
#define YOUR_HEADER_FILE_INCLUDED

// Whatever else you need in the header file

#endif

Also try using the following statement at the beginning of your app

#define WIN32_LEAN_AND_MEAN
Sometimes this statement alone helped me solve the problem
Ivan** at 2007-11-11 20:59:21 >
# 2 Re: Bitmap - Wingdi.h
solved the problem.
nivrobin at 2007-11-11 21:00:16 >