Noob in need _

Started by
7 comments, last by Deus Ex Otium 19 years ago
Hey, I need to know how to use controls. (NO! Not Keyboards or Joysticks!) You know, like edit boxes and list boxes. I've seen them everywhere, but no tutorials are basic enough. I don't know what to link, include, or anything that simple. Anyway, can someone point me in the direction of a good tutorial? (And maybe answer my questions?)
Advertisement
What language?
-----------------------------Play Stompy's Revenge! Now!
If it's c++ I would recomend this site:
theForger's Win32 API Tutorial

If it's not c++ I would recommend this site:
Google [google]
error C2065: 'signature' : undeclared identifier
Yesh, it's c++. I did go to ths site to try to get help: http://winprog.org/tutorial/controls.html
but when I tried it out, the compiler (MSVC) didn't know what IDC_TEXT was. Looking at the source code, it seems the author of the tutorial defined it himself.

I figure that I would do my own work; I would not use other people's source code so I could learn more :


Are there any other free tutorials that DON'T rely on their own definitions (or whatever) to work? Or am I just missing something?
I have to agree with RaptorZero...the forgers win32 api tutorial (online or PDF) is the place to look.

Are you having trouble creating a Windows Application? What IDE are you using? Have you tried DEV-C++. It's free and pretty powerful.

Good luck.
Gary.Goodbye, and thanks for all the fish.
I did try devC, but I couldn't find support for resources, so I got Microsoft Visual C++.

Like I said, I did look at theForger's tutorial, but (also as I said :P) the code they used mentions IDC_TEXT, but my compiler doesn't recognize it. I looked at the source code used in the tutorial, but it seems IDC_TEXT was defined by theForger. I just need to know why he defined it (and everything else he defined) the way he did. Or a different tutorial would be okay :)
I may be wrong as I dont do much win32 programming in c++, but IDC_TEXT looks like it just refers to a textbox, and you can probably define it as whatever you want, as long as its not the same as another control.

Edit:
In other words, you could have something like this:
#define IDC_TEXT 100#define IDC_TEXT2 101#define IDC_TEXT3 102


That would let you have 3 textboxes, and the numbers apparently tell the win32 api which one you are refering to.
Quote:Original post by Deus Ex Otium
I did try devC, but I couldn't find support for resources, so I got Microsoft Visual C++.

Like I said, I did look at theForger's tutorial, but (also as I said :P) the code they used mentions IDC_TEXT, but my compiler doesn't recognize it. I looked at the source code used in the tutorial, but it seems IDC_TEXT was defined by theForger. I just need to know why he defined it (and everything else he defined) the way he did. Or a different tutorial would be okay :)

#define commands (when not being used to define a macro) are usually used to give an alias for a constant. When working with Win32 controls, you supply the system with ID numbers so that when you recieve a message saying a button was pressed, you can check the ID number and find out which one. You could just pick a number, say 107, and say that is the ID for a given control. However, this would make your code confusing and you would probably forget which numbers were for which controls. The solution is the #define command.
#define IDC_EDIT 107
You put that line at the top of an appropriate source file and then whenever you want the ID for your edit control, you type IDC_EDIT instead of 107. It makes the code more readable, and also allows you to change the value of the edit control's ID just by changing one line. There is nothing wrong with using #define commands; everyone does it. However, if you are alergic to them or something, for this specific usage you can replace the #define directive with const int, like this:
const int IDC_EDIT 107;
That does essentially the same thing, but in terms you might find a bit easier to understand.
Thanks for the help, guys. (God, I love this community)

I thought I was missing a lib or header file or something... Yeah.

This topic is closed to new replies.

Advertisement