Click to See Complete Forum and Search --> : help for a win32 starter
indiocolifa
March 4th, 2003, 01:12 PM
Hi folks.
I'm learning Visual C++ with "Beginning VC 6" by Ivor Horton, and I'm doing pretty well (understading at good level all the classes and OOP theory), and I'm preparing for the Chapter 13, which is MFC programming (i'm currently at Ch. 10).
But, I want to be able to program some Win32 API, altough it seems that in most sites, Win32 API programs are coded in C (not C++)
Can I use my C++ knowledge to program the raw Win32 API?
Should I code Win32 in C or C++?
Of course, I won't ask for the controversial MFC vs. Win32 theme, but I want to know if it's worth spending time learning Win32, or it's better to learn C++ classes and go directly to MFC.
Thank you!!!!!
Paul McKenzie
March 4th, 2003, 01:19 PM
Originally posted by indiocolifa
But, I want to be able to program some Win32 API, altough it seems that in most sites, Win32 API programs are coded in C (not C++)
Can I use my C++ knowledge to program the raw Win32 API?
Should I code Win32 in C or C++?
Yes, you can use C++. The only thing that is 'C' are the calls to the Windows API functions. The following code works fine:
#include <windows>
#include <string> // This is a C++ header
int main()
{
std::string s = "This is a test";
int *p = new int;
MessageBox(NULL, s.c_str(), s.c_str(), MB_OK);
delete p;
}
I mixed the Win32 API call with the C++ string class, plus added a new and delete to prove that C++ is perfectly valid to be used in a Win32 program.
Regards,
Paul McKenzie
Bengi
March 4th, 2003, 01:49 PM
staring to learn win32 API coding is not hard, but IF you try learn MFC before, ur into a wrong turn.
for Win32 API learning, u should first read Win32ASM Api, it is PURE api coding and will help you dearly as i did and still doing.
www.win32asm.cjb.net
Paul McKenzie
March 4th, 2003, 02:24 PM
Originally posted by Bengi
staring to learn win32 API coding is not hard, but IF you try learn MFC before, ur into a wrong turn.
for Win32 API learning, u should first read Win32ASM Api, it is PURE api coding and will help you dearly as i did and still doing.
www.win32asm.cjb.net I agree that you should learn the API first if you want to learn the API and MFC. You don't have to learn assembly though -- you can still learn the API using C or C++.
Regards,
Paul McKenaie
indiocolifa
March 4th, 2003, 02:30 PM
I will go for a basic Win32 learning, after that, I will learn MFC.
A link with a good Win32 tutorial or FAQ please?
thanks!:D
indiocolifa
March 4th, 2003, 08:18 PM
Any *specific*:) recommendation to learn the Win32 API?
What I should avoid and what I should look carefully?
thank you.
:P
filthy_mcnasty
March 4th, 2003, 09:45 PM
the ultimate guide to the win32 api by charles petzold is a good read. this very web site has a lot of useful info as well. planetsourcecode.com is a good one too.
galathaea
March 4th, 2003, 10:10 PM
Also, get comfortable with looking up things on msdn.microsoft.com (or, alternatively, the help files if you have Visual C++) and check out the SDK documentation. This has the prototypes for each function and details on the use of the function parameters. Together with a good book like Petzold and you will have a pretty good start.
And you should try to figure out how you would wrap up the API's into classes, and what type of design you think would best suit your needs for interfacing with the OS. You don't need to do the wrapping yourself, as there are many libraries out there that assist in this (one of which is MFC, but keep in mind that it is not the only solution), but if you are looking to program in c++, you should take advantage of its abilities and not sprinkle your code too heavily with naked API calls. In the professional world, this will make your code more difficult to maintain and defeat the purpose of using a strongly structured language like c++ with all of its object-oriented and generic programming support...
Samosa
March 8th, 2003, 09:40 PM
I'm currently also learing the win32 api, I've stumbled upon something of a gem, I think its worth checking out
Win32 tutorials (http://gametutorials.com/Tutorials/Win32/Win32_Pg1.htm)
Bengi
March 9th, 2003, 08:58 AM
http://winprog.org/tutorial/
indiocolifa
March 9th, 2003, 11:28 AM
thanks people for the links to the tutorials.;)
eug_prog
March 11th, 2003, 05:47 PM
Wow, the sites you guys listed for Win32 API tutorials are really a gem! Thanks a lot - they are very useful for WinApi novices, like myself.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.