Advertisement Jump to content
Sign in to follow this  

Learning the Win32 Api/GDI/MFC? Help.

This topic is 4881 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am reading the first sections of Special Effects Game Programming with DirectX, and I'm getting kinda confused. Basically I'm confused on the different types of programming for Windows. I have heard multiple terms. The Win 32 API, the Win 32 GDI, MFC, and Visual C++. I assume all four are ways to develop applications for windows. Which am I learning now. I think I'm learning the Win 32 Api right now, but I don't really know. What are the differences and similarities of those others I mentioned. What is MFC, Win32 GDI/API, Visual Programming? I am also completely lost on what a "handle" is? What the heck are they talking about, when they refer to handles? Is it like a pointer or something? A reference to an object? It comes up quite alot. Thirdly I am confused slightly on all the different types that are presented in DirectX. Let me list some of them for you. HINSTANCE, LPSTR,WNDPROC, HANDLE, HICON,HCURSOR, LPCTSTR. Why are they doing this? The only types I know are the ones from C++. You know.....ints, floats, characters, and strings? No? I know the WNDPROC is a pointer to a function. In SDL it wasn't this bad, the tradition al types just had be universified, but they were still ints, floats, and chars. Any advice? One more question. What exacly does the Scope Resolution Operator do? The "::". The only time I used it is when I defined a class member funtion. You know.....Cat::Purr(string sound)? They have used the scope resolution operator in these two ways to confuse me. They declare iterators with them in this fashion. Vector<int>::iterator. I guess I want to know where the heck the :: is taking us in the code. Is it taking me to a class member? Another great one."::MessageBox". There there isn't even anything before it? What does the MessageBox function belong to? I guess any help would be appreciated.

Share this post

Link to post
Share on other sites
MFC is the C++ layer of the Win32 GDI (in C). It's easier for developers in the business. GDI is the graphics device (used to make circles, rectangles, images, etc.). DirectX only requires you to know how to make a blank window. Until you learn DirectInput, you'll need to learn Win32's way of allowing keyboard and mouse input. A handle is basically a window handle, a button handle, etc. If you want to set a button's position, you usually go through its handle. I hope this helps a little.

Please look into this website. It's a great tutorial on the Win32 API and GDI. You should know these before starting DirectX. It saves headaches later.

FunctionX: The Win32 API

The scope resolution operator (::) allows you to view public methods & variables that are contained within a certain class.

For example,

class Player
std::string name;
int age;
void doSomething() { cout << "RAR!" << endl; }

If you do this,


You'll see the variables "name" and "age" public. You can set these as methods too. Such as,

Player::doSomething(); // it'll output "RAR!"

It is outside of any object of type Player. Console::Title = "My Title"; is probably a better example. It's not instantiated as an object to produce this result. Setting an age with the scope resolution operator won't work... obviously, you'd need an object to store that data. I hope this helps, but please do read on the Win32 API and study more on C++. I don't think you're quite ready for DirectX yet, but you do have a great mind for learning. Good luck!

[Edited by - dxFoo on September 6, 2005 10:36:23 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!