Title: Question on Message Boxes and the sort
Description: I'm new at this...
Starkin Program - March 27, 2005 10:27 PM (GMT)
How would you create a Message Box that has a place to put in a String, then you press enter (or something of the like) and returns the string? If that seems confusing, I want something like the Game Maker function get_string.
Thanks in advance!
P.S. I've looked at MSDN, and haven't been able to find anything of the sort...
Edit: Something that returns an interger/double/whatever works too.
Edit2: If it means anything I'm using it in a DLL that I'm using with Game Maker.
ih8censorship - March 27, 2005 11:25 PM (GMT)
your going to need to either learn to make windows or dialogs and an edit control, and then use the GetDlgItemText function or GetDlgItemInt function. to make windows and dialogs your going to need to know enough how to work structures ,pointers, and a few basic types such as HWND. any more questions just ask ^_^
Starkin Program - March 28, 2005 01:20 AM (GMT)
Hm.... Alright... Seems to be a bit ahead of where I am now...
I really don't have any Win32 experience, besides making Message Boxes, and heck I'm still learning how to do basic C++ through the C++ Primer third edition...
I thought it would be quite a bit easier, but oh well. Nonetheless thanks!
ih8censorship - March 28, 2005 01:29 AM (GMT)
yep ^_^ once you understand functions, pointers, and structures you have most of what you need to really get started in windows api programming. dont give up learning!
Starkin Program - March 28, 2005 01:33 AM (GMT)
I do have a few questions if you don't mind, actually, only 2...
My first one is what exactly is the point of having a pointer to a function. I'm seeing them everywhere in the C++ Primer and I don't really get them.
And my second one is could you give a brief explination of what structures are and what they're for, or a link to somewhere that does?
Thanks in advance!
donprogc++ - March 28, 2005 02:00 AM (GMT)
for your first question:
http://www.newty.de/fpt/index.html2nd question:
start off with an example
| CODE |
struct employee { public: char name[15]; //name int id; // id number double wage; // how much an hour };
employee bob; // declare struct bob
bob.name = "bob"; // set name for bob bob.id = 00561; // set id number bob.wage = 6.50; // set wage
employee jim; // declare struct jim
jim.name = "jim"; // same with jim as for bob jim.id = 00562; jim.wage = 7.00
cout << bob.name << endl; // print bobs name cout << bob.id << endl; // print bobs id number cout << bob.wage << endl; // print bobs wage
cout << jim.name << endl; // same as for jim cout << jim.id << endl; cout << jim.wage << endl;
|
structs are for making your own data type and can be used just like classes in c++ except that default they are declared public and classes default are declared private
Starkin Program - March 28, 2005 02:08 AM (GMT)
Ah, I get it. Structs look a lot easier now. And thanks for the site on pointers to functions, I didn't realize there was so much to them!
Thanks for the help!
Shackleb0lt - March 28, 2005 04:18 AM (GMT)
but arent' classes better if you're using c++?
ih8censorship - March 28, 2005 04:28 AM (GMT)
the thing that really got what a struct is into my brain was the explaination that its kind of like an array, but with different data types.
Shackleb0lt-
http://invisionfree.com/forums/CPPlearning...?showtopic=3998so basicaly C++ structs ARE classes, by default members are public, and with a class by default members are private
donprogc++ - March 28, 2005 04:36 AM (GMT)
structs derived from C but in c++ they do the same thing as classes
C didnt have classes only structs and C structs are different from C++ structs