Author Topic: [Solved] ColorDialog API problem  (Read 5115 times)

Offline rittwik

  • Single posting newcomer
  • *
  • Posts: 7
[Solved] ColorDialog API problem
« on: May 26, 2008, 11:39:11 am »
I am using codeblocks-8.02mingw-setup in Windows XP. While trying to compile the following code, I get the error:

Code:

/.......
case WM_CREATE:
            {        CHOOSECOLOR col;
                      COLORREF color = RGB(0,0,0);
                      col.lStructSize=sizeof(CHOOSECOLOR);
                      col.hwndOwner=hwnd;
                      col.Flags=CC_SOLIDCOLOR;
                      col.lpCustColors=&color;
                      ChooseColor(&col);
            }
            break;
......./

Error:

Linking console executable: bin\Debug\test.exe
obj\Debug\main.o: In function `Z15WindowProcedureP6HWND__jjl@16':
C:/Documents and Settings/user/Desktop/test/main.cpp:84: undefined reference to `ChooseColorA@4'
collect2: ld returned 1 exit status

Can anyone help me on this?

Thanks
rittwik
« Last Edit: May 26, 2008, 01:39:59 pm by rittwik »

Offline rittwik

  • Single posting newcomer
  • *
  • Posts: 7
Re: ColorDialog API problem
« Reply #1 on: May 26, 2008, 12:53:12 pm »
Sorry, forget to mention that the problem is occuring only with MinGw 4.2.1. There is no problem compiling  the code with Borland C++ 5.5.

Thanks
rittwik

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ColorDialog API problem
« Reply #2 on: May 26, 2008, 01:00:55 pm »
Hi !

Did you check in your project settings that comdlg32 is present in the linker properties ?

Dje

Offline rittwik

  • Single posting newcomer
  • *
  • Posts: 7
[solved] ColorDialog API problem
« Reply #3 on: May 26, 2008, 01:37:54 pm »
Thanks Dje, it works now... :D

rittwik