Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Get color from windows color dialog?

Author
Message
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 6th Nov 2008 14:36 Edited at: 11th Nov 2008 10:45
I cannot save the color I get from the color dialog! What is wrong?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 6th Nov 2008 21:05 Edited at: 6th Nov 2008 21:05
I don't know, maybe the fact that you're treating 'color' as if it contains the address of a string. If you want to output the value of it, you do this:



There may be something else wrong but I don't really have the time or patience to check right now, besides I'm not using windows anyway so I wouldn't be able to compile it.

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 6th Nov 2008 22:39
"color" is a DWORD, not a char* and cannot be cast to a char*. Use itoa.
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 11th Nov 2008 11:13 Edited at: 11th Nov 2008 11:14
I only get errors when I try:
itoa(color, text, 10);

But I can convert the DWORD value into float! But the text change color into black instead of the chosen color when I press the Return Key:

Login to post a reply

Server time is: 2024-09-30 11:19:14
Your offset time is: 2024-09-30 11:19:14