The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> C Programming
|
win32 c VS win32 c++?
Discuss win32 c VS win32 c++? in the C Programming forum on Dev Shed. win32 c VS win32 c++? C programming forum discussing all C derivatives, including C#, C++, Object-C, and even plain old vanilla C. These languages are low level languages, and used on projects such as device drivers, compilers, and even whole computer operating systems.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

May 21st, 2003, 01:59 AM
|
 |
Contributing User
|
|
Join Date: Jul 2002
Posts: 95
Time spent in forums: 1 h 16 m 5 sec
Reputation Power: 11
|
|
|
win32 c VS win32 c++?
I was told by a friend that if you choose to learn the windows api that you can choose to code it in c or c++. Is this true? which is a better idea if you know both of them about the same but would need to "brush up"?
Thanks,
Dan
|

May 21st, 2003, 08:37 AM
|
|
Not there when you need me
|
|
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,430
Time spent in forums: 17 m 46 sec
Reputation Power: 13
|
|
|
The Wintendo API is basically C-oriented. So, if you like, you can use that. If, however, you want to use C++, you'll have to use something to get the API's functionality in an OO way, e. g. via MFC or Qt.
|

May 21st, 2003, 09:40 AM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
|
Basically, everything you can do in C you can also do in C++. So you should be able to take a C program and recompile it in C++. In practice, there may be a few minor errors; e.g., when I first tried it I found that two macros were defined in my C compiler but not in my C++ compiler.
Windows API programming (originally SDK, for "software development kit") is classically done in C. If you read Petzold's books you will find all the code to be in C.
MFC and other frameworks are done in C++ in order to encapsulate the message loop and other details of SDK and to provide a set of base classes that you can extend. If you don't want to use a framework (which you are indicating is the case), then you could still do your SDK programming in C++ just for "better C" reasons and for creating and using your own classes for non-GUI purposes.
So you could indeed use either C or C++. I would advise using C++ since it would be the upward migration path, it contains all the features of C anyway, and since restricting yourself to C would be over-restrictive for no good reason.
|

May 21st, 2003, 12:57 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
|
If you look at the MFC classes, quite a lot of them are actually very thin wrappers around the native C API functions. By comparison, Borland's older OWL and newer VCL class libraries are much more object oriented.
Frankly, I learned the basics of Windoze programming from the Petzold book, and then went straight to Delphi, C++ Builder and Visual C++. Before programming in Delphi, I also dabbled with Borland C++'s OWL library a bit. The Petzold background helped quite a bit, when I was programming Visual C++. In fact, I actually ended up writing one project in native C, simply because it had to be as lean and mean as possible. I think it's useful to skim over it, just so that you know how things were done before MFC. That information could come in handy for you too.
BTW, I was already a fairly decent C/C++ programmer, before I even did any Windoze programming, so that was at least one hurdle that I didn't have to jump over.
Last edited by Scorpions4ever : May 21st, 2003 at 01:35 PM.
|

May 21st, 2003, 01:21 PM
|
 |
Contributing User
|
|
Join Date: Jul 2002
Posts: 95
Time spent in forums: 1 h 16 m 5 sec
Reputation Power: 11
|
|
|
Thanks a lot for your help guys, appriciate it!!
Dan
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|