Advertisement

Newbie got jammed over here and needs advice

Started by March 05, 2002 11:48 AM
12 comments, last by savagerx 22 years, 9 months ago
Sorri for the confusion.

Actually, it is the code below that solved the prob but wat I don''t understand is where I went wrong? Is it the "OL" thing or something else. Well, that''s my mental block.
quote:
static TBBUTTON buttons[] = { { 0, IDM_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 }, { 3, IDM_SAVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 }, { 1, IDM_UPPERCASE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 }, { 2, IDM_LOWERCASE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 }, { 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0 }, { 4, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0 },};



The road may be long, wind may be rough. But with a will at heart, all shall begone. ~savage chant
The road may be long, wind may be rough. But with a will at heart, all shall begone. ~savage chant
Don''t Worry about the 0L thing. Stating 0L is just another way of writing 0, it just tells the program that it is a ''long'' number (long integer), much like 0.0f tells the program that the number is a float.

I''ve said it before and I''ll say it again, I''m not good with this type of windows program, I write games in which you only open an OpenGL complient window and then render to it. But after analysing the two pieces of code I think I know the difference between them.

The way Jason Zelos initialized the buttons was exactly the same as yours except for all instances of BTNS_BUTTON were replaced with TBSTYLE_BUTTON. I don''t know if you have used this type of initializer before but it is a shorthand way of filling in all the members quickly and easily.

Where you went wrong was you used the wrong reference to setup the fsStyle member of the Buttons[] object. BTNS_BUTTON obviously doesn''t exist (you can tell from the error message that you got). I suggested including ''afxwin.h'' thinking that you just forgot to include the right header, but it turns out that you just typed in the wrong name. Your original code will compile and work (I hope!!) if you just replace all instances of BTNS_BUTTON with TBSTYLE_BUTTON.

I think thats what was wrong.

-Weasalmongler
Advertisement
Yep, just spelling mistakes.

you used OL instead of (zero)L,
BTNS_BUTTON instead of TBSTYLE_BUTTON and,
BTNS_SEP instead of TBSTYLE_SEP.

''undeclared identifier'' means simply that the compiler/linker cannot find any such constant,class or varible (inc struct''s).


,Jay
Gee... Tkx for your enlightenment. <- newbie lah.

The road may be long, wind may be rough. But with a will at heart, all shall begone. ~savage chant
The road may be long, wind may be rough. But with a will at heart, all shall begone. ~savage chant

This topic is closed to new replies.

Advertisement