UnknownUser
UnknownUser

Reputation: 133

CHOOSECOLOR undeclared identifier

I'm creating a win32 project and for some weird reason Visual studio doesn't recognize the CHOOSECOLOR function. I keep getting the " choosecolor' :undeclared identifier" error. what do I do??

my current code that causing the error.

void cColor(HWND hwnd, int select)
{
CHOOSECOLOR cc; //common dialog box structure




}

any help on how i can resolve this problem, would be very much appreciated.

Upvotes: 0

Views: 1245

Answers (2)

blaz11
blaz11

Reputation: 23

I know that this is VERY old. However I had the same problem and found the solution so for future seekers: make sure that you don't

#define WIN32_LEAN_AND_MEAN

it makes that it doesn't include rarely-used stuff, including CHOOSECOLOR.

Upvotes: 1

Mark Ransom
Mark Ransom

Reputation: 308158

The CHOOSECOLOR structure is defined in Commdlg.h, which is automatically included when you include Windows.h. You can find this on Microsoft's documentation by looking toward the bottom of the page where it says "Header".

Often Windows.h will be included in stdafx.h.

Upvotes: 4

Related Questions