I am covering a book tutorial about programming win32 and when I am compiling the code provided,
radio buttons doesn't show when are checked, instead the checkbox that is in the same dialog window
shows when it is checked.
Yes, I had placed a brakepoint after the CheckRadioButton RADIO1 function at the "break" statement.
When I press the Radio1 radio button the program goes and stops at the breakpoint, but what I had observed is that when a press play again to the compiler the program continues to execute and then it's comes back at the break point without to press again the radio button.
Check in Resource.h file to see if those two radio buttons has consecutive values ... might be a problem if they are not.
Yes, that it was, in the resource.h the values of the radio butons were reversed, first it was Radio2 then Radio1. I putted their correspondent values in increasing order and problem was solved.
Many thank Flaviu
I just created a quick test with your code and it works fine. There must be something else happening that we cannot see. As suggested by Flaviu above, please check the defined values for the dialog buttons.
In addition what was said before, I suggest you add a default case for the inner switch in WM_COMMAND. Then set a breakpoint on that default. Maybe you're missing a case in that switch statement?
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
I got a strange message from my compiler. Same code, same (at nearly) settings for Debug and Release versions. But what is more important, same files and same code! But when I try to create Release version, I get this:
Thank you, your tip was useful. I checked all places in the project's settings where I met the word "manifest" and found one, where settings for Debug and Release were different. Release wanted to generate manifest file, but Debug did not. I excluded manifest generation for the Release version and finally got it.
Look, guys, I have a code that worked properly under Windows XP 32 bit.
hHookMsg = SetWindowsHookEx(WH_JOURNALPLAYBACK, hkprc, hInst, 0). But under Windows 7 64 bit this call failed and I got System Error Message "Acces denied"
I tried this:
hHookMsg = SetWindowsHookEx(WH_JOURNALPLAYBACK, hkprc, hInst, GetCurrentThreadId())
hHookMsg = SetWindowsHookEx(WH_JOURNALPLAYBACK, hkprc, (HINSTANCE)NULL, GetCurrentThreadId())
and got "This hook can be set only globally".
Any ideas how to resolve the situation?
They have put security around that sort of thing and you probably have to be running as administrator and it's likely going to throw a UAC to user to confirm it is okay. Goto MSDN and look at the documentation.