Please let me know where to fix the sync error in windows 7mingw windowres.

Asked 2 years ago, Updated 2 years ago, 142 views

http://wisdom.sakura.ne.jp/system/winapi/win32/win85.html
The second resource in the above sample fails.

/*Resource Script*/
KITTY DIALOG 10, 10, 100, 50
FONT12, "MS Gothic".
CAPTION "Magic nyanyan TARUTO" {
LTEXT "Exit\nAre you sure?",-1,5,5,90,20
PUSHBUTTON "OK", IDOK, 40, 35, 20, 10
PUSHBUTTON "Cancel", IDCANCEL, 65, 35, 30, 10
}

Synatx error in PUSHBUTTON in line 6 above.Also, if you set #defineIDOK1001 in #include"resource.h", it will work for now.Now, I can't recognize IDOK even if I press the OK button.

"Also, regarding this, ""Cancel"" in line 7 is also a syntax error."What's wrong?

I'm sorry.Please answer the wrong part and the correct description.
Thank you for your cooperation.

windows gcc

2022-09-30 19:23

1 Answers

#include"resource.h" to #defineIDOK1001 for now.

In the Windows SDK, IDOK is reserved for 1 and IDCANCEL is reserved for 2.Manually #define these constants are correct, but it is better to #include the header file winres.h provided by the SDK.

Now, I can't recognize IDOK even if I press the OK button.

This is because the ID assigned to the OK button (1001 in your code) on the resource does not match the ID that Windows expects from the OK button (1 mentioned earlier).


2022-09-30 19:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.