C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 21st, 2003, 02:59 AM
x51's Avatar
x51 x51 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 95 x51 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 5 sec
Reputation Power: 7
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
__________________
C:\DOS C:\DOS\RUN RUN\DOS\RUN
http://www.dandland.com

Reply With Quote
  #2  
Old May 21st, 2003, 09:37 AM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,438 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 9
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.

Reply With Quote
  #3  
Old May 21st, 2003, 10:40 AM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 3,949 dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level)dwise1_aol User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 16 h 1 m 36 sec
Reputation Power: 523
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.

Reply With Quote
  #4  
Old May 21st, 2003, 01:57 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,681 Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 57 m 29 sec
Reputation Power: 1083
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 02:35 PM.

Reply With Quote
  #5  
Old May 21st, 2003, 02:21 PM
x51's Avatar
x51 x51 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 95 x51 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 5 sec
Reputation Power: 7
Thanks a lot for your help guys, appriciate it!!

Dan

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > win32 c VS win32 c++?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT