question

DanielShepherd-8507 avatar image
0 Votes"
DanielShepherd-8507 asked RLWA32-6355 commented

C++ expected an expression on status bar

I am on the tutorial on winprog.org, and I am making a status bar. here is my code:

 hStatus = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, 0, 0, 0, 0, hWnd, (HMENU)IDC_MAIN_STATUS, GetModuleHandle(NULL), NULL);

errors:
117687-screenshot-2021-07-25-163158.png
also by status bar, i mean like this:
117698-status-bar.png


windows-api
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The intellisense error message flags line 144 in your code. There is nothing in the posted code that would cause the E0029 error.

So the problem is related to something else.

0 Votes 0 ·

So, I had to #define IDC_MAIN_STATUS and added an id to it, and it worked.

0 Votes 0 ·

If a #define for IDC_MAIN_STATUS did not exist in resource.h that would have been flagged by intellisense as a separate error - E0020 identifier 'IDC_MAIN_STATUS' is not defined.

So if that intellisense error was not present then resource.h did include a #define for IDC_MAIN_STATUS but there was no value assigned to it.

0 Votes 0 ·

0 Answers