PDA

View Full Version : C++ Win*2 API tutorial?



Moonbat
03-16-2007, 05:06 PM
I've Googled for C++ WinAPI tutorials, but the ones I get use C coding. I need one that's organized and uses C++ code. If anyone can help me, I'd appreciate it.

Ezekiel
03-16-2007, 05:31 PM
I've Googled for C++ WinAPI tutorials, but the ones I get use C coding. I need one that's organized and uses C++ code. If anyone can help me, I'd appreciate it.

The Windows API functions are mostly the same regardless of the language you're using; C, C++, VB -- they all have the same function names and the same parameters.

C is not very different from C++ in most ways, and most C code will compile as C++. I've found that most API tutorials are written with C in mind, but that's fine because the usage of the Windows functions is what we're looking for, and the context does not really matter. You can see how things are done then implement it in your own code, re-written according to C++ rules.

The WinAPI isn't something that is covered in one tutorial. There are many different parts of it that are covered separately.

First, you should have a reasonable knowledge of your chosen language. I see that's C++. In this case, as an example you should know instantly what these words mean:


Variable
Function
Preprocessor
Pointer
Reference
Parameter
Argument


Next, you should ask yourself what you want to do with the language. Do you want to display windows instead of boring console applications? I'd say write at least a couple of decent console applications in Windows first to get used to programming. Windows GUI programming is relatively easy when you know how, but at first you look at it and, frustrated, you curse how needlessly complicated it is. People new to programming always want to know how to display a window, but it's not that important.

Anyway, getting back to the point, these two resources will prove to be invaluable when programming with the API:

http://msdn.microsoft.com/library
ftp://ftp.cs.virginia.edu/pub/lcc-win*2/win*2hlp.exe

The second is a help file for the API, although I got mine elsewhere.

For making windows, search Google for windows api GUI tutorial or something like that. There are many, most for C.

For network programming, search for "Johnnie winsock" and you'll find the tutorial he keeps moving around.

Moonbat
03-16-2007, 06:36 PM
Thanks for those two links mike. I know that C can be compiled on C++ compilers, but I was thinking that C++ WinAPI was really different from C WinAPI, but according to you, it's not.

But I've got a question. By "decent console applications in Windows" do you mean just normal DOS-window C++ programs?

Ezekiel
03-16-2007, 06:51 PM
Thanks for those two links mike. I know that C can be compiled on C++ compilers, but I was thinking that C++ WinAPI was really different from C WinAPI, but according to you, it's not.

They're pretty much the same, yes.


But I've got a question. By "decent console applications in Windows" do you mean just normal DOS-window C++ programs?

Yeah, just learn how to program independently of any GUI concepts so you don't rely on Windows' provisions later. This way you learn that programs should be about accomplishing something, not about creating fancy-but-pointless menus and such.

I've got that feeling again... The feeling that this forum is dead and we're the only two posting.

Moonbat
03-16-2007, 06:56 PM
Hmm.. yeah, it seems so. But fear not, the spambots will kill that feeling before you can say 'Mass Deletion.':D

Well anyway, thanks for the help mike.

tocksarcle
03-22-2007, 06:16 PM
http://www.relisoft.com/win*2

This one teaches the windows API using C++, not just plain ol' C (doesn't really make much of a difference though)

Ezekiel
03-22-2007, 06:57 PM
http://www.relisoft.com/win*2

This one teaches the windows API using C++, not just plain ol' C (doesn't really make much of a difference though)

When I was learning about Windows programming I seem to remember that tutorial made things needlessly difficult, telling you to make your own classes to encapsulate tasks instead of keeping it basic. Reading it now, I can see that it's actually better from the material I learned from.

Tito
04-14-2007, 06:01 AM
Heres some C++ eBooks you might find useful.

http://rapidshare.com/files/*7664284/Addison_Wesley_-_Advanced_CORBA_Programming_with_C__.chm.html"

Or http://www.MegaShare.com/**6242
_____________________________________________________________
http://rapidshare.com/files/*766*6**/addison_wesley_-_essential_c__.chm"
or http://www.MegaShare.com/**624*
_______________________________________________________________
C++ Style_4New_Engineering_Puzzles http://www.MegaShare.com/**6245
_____________________________________________________________
http://rapidshare.com/files/*766*72*/Addison_Wesley_-_Exceptional_C__.chm.html"
--------------------------------------------------------------------
http://rapidshare.com/files/*766*75*/Addison_Wesley_-_Imperfect_C___Practical_Solutions_for_Real-Life_Programming.chm.html"
------------------------------------------------------------------------
http://rapidshare.com/files/*766*77*/Addison_Wesley_-_Inside_the_C___Object_Model.chm.html"
------------------------------------------------------------------------
http://rapidshare.com/files/*7664**0/Addison_Wesley__-_Parallel-and-Distributed-Programming-Using-C__.chm.html"
--------------------------------------------------------------------------
http://rapidshare.com/files/*7664**5/Addison_Wesley_-_Applied_C__-_Practical_Techniques_for_Building_Better_Software.chm.html
-----------------------------------------------------------------------
http://rapidshare.com/files/*7664*54/Addison_Wesley_-_C___Coding_Standards_*0*_Rules_Guidelines.chm.html
------------------------------------------------------------------------
http://rapidshare.com/files/*7664*6*/Addison_Wesley_-_C___Common_Knowledge_Essential_Intermediate_Programming_.chm.html
------------------------------------------------------------------------
http://rapidshare.com/files/*76644*7/Addison_Wesley_-_C___Network_Programming_Vol__*.chm.html
------------------------------------------------------------------------
http://rapidshare.com/files/*76645**/Addison_Wesley_-_C___Standard_Library__The_A_Tutorial_and_Reference.chm.html
----------------------------------------------------------------------
http://rapidshare.com/files/*7664558/Addison_Wesley_-_C___Template_Metaprogramming_Concepts_Tools_and_Techniques_from_Boost_and_Beyond.ch.html
---------------------------------------------------------------------
http://rapidshare.com/files/5*5**4*/cgc.rar Creating games in c++

copy & paste some of them. Rapid Share downloads are all different ebooks