newbie to c++

when i first started programming i wanted to learn c++ so i started reading up on it(this was about 2 years ago). i learned the basics and then i got pulled into the java programming language. though i was new to the java programming language, suns site had a tutorial section(that starts after the basics) and explains advanced features like GUIs and whatnot... im actually quite good in java now and ive hit a problem that i know i can fix in c++. i basicly wanted to know if msdn has a tutorial-like section on the site(not a class that i would have to take) that explains such things like GUIs and other complicated features of the language so that i can start off where i left off when i first got side tracked from the language and hopefully catch up to where i am in Java.


Answer this question

newbie to c++

  • Eric H.

    Good point - programming for Windows with the C++ Express edition is a waste of time, winforms is much easier in C#.



  • JoelMags

    I think, based on what you know about Java, that you will find the best materials to be on C# and you can install the free VC# 2005 Express Edition to do many of the things you are accustomed to in the Java programming model.

    For VC++ 2005 Express Edition, there is nothing comparable to the Java Tutorial (a wonderful set of books, CDs, and on-line editions). And the Microsoft Foundation Classes (MFC) are not available with the Express Edition. You'll need a commercial version of VC++ 2005 to use MFC to build native Win32 applications.

    There are some good books on programming in C/C++ with the standard libraries, and some books are available for free on-line. Check this forum thread. And this thread discusses some books on VC++.

    I have a stack of books waiting to be added to my web page, but I've been distracted by others things at the moment.

    - Dennis



  • bshalton

    // c# is that its not object orien

    In fact, C++ is only sort of object orientated, it's not possible to write C# code that is NOT OO. You can't add a single method or property outside of a class or struct, nor is there even a global namespace.



  • HwaH

     sosleepy wrote:
    the only problem i have with c# is that its not object oriented... ever since i started programming ive found that its a lot easier to work with objects(especially when it comes to possibly making games)

    [ ... ] it seems to be the best way i can manage what is shown on the screen because using the graphics class gave me un-smooth images when they were shown, and the buffered image didnt work as fast as i wanted it to. i turned to c++ because i heard it was the best choice to handle these problems and since i alread had some experiance with it i figured it would be better that starting from the beggining from any other programming language

    I'm not sure I understand the claim about C# not being object-oriented.  Do you find that Java is not object-oriented  

    If you intend to operate with the native Win32 API, it is not object-oriented at all in the sense of exposing classes.  It is all C Language calling with state held by handles.   And you have to deal with a message thread and the dispatching of GUI components in pretty much the same way.  If you haven't used the Win32 API before, you'll find it is very much like learning a new language, even though it is being carried atop C/C++ as you may prefer.

    I don't want to discourage you, just calibrate your expectations.  I also want to promote a progressive learning approach that allows early success with small experiments that can be built upon.

    The days of directly operating with the screen are pretty much gone (even though you can manipulate pixels through display structures).  I think you'll will want to check out DirectX.  There are managed (.NET languages) and unmanaged (native Win32) APIs for it, and the DirectX Development Center provides access to the latest goodies.

    To calibrate yourself, I recommend Coding4Fun and the Beginning Game Development treatment of DirectX and DirectSound there.

    Here's my proposition for you to consider:

    1. Visual C# 2005 Express edition is complete out of the box and does not require the Windows Platform SDK (You will need .NET 2.0 either way for development using either VC++ Express or VC# Express).  You can use VC# as a perfect proof-of-concept and rapid confirmation development environment.  There's far more new material on using the .NET languages in this way than you'll find on using Visual C++ the same way.  You'll also quickly gain some sense of the performance and where you can't live with it.

    2. If you don't want to ship .NET or the performance does pinch too much for you, you can get closer to the metal two ways:  First you can use Visual C++ 2005 Express edition simply as a .NET language.  So you can port your code to Visual C++ and confirm that it still works as a managed application.  (This is the C++/CLI dialect, which is supported by VC++.)

    3. Secondly, you can go completely to unmanaged (native Win32) code, you can convert to the unmanaged DirectX API and use nothing but native Win32 APIs and libraries (no more System classes, etc.).  It would be nice if there were wrappers to hide the differences between the native and managed APIs and their respective "objects" but I don't know of any myself.  Others can tell you more.  In any case, having done (1) and maybe (2) should give you a way to gradually confirm that everything still works, and you can decide if the performance improvement you are gaining is worth it by porting small critical parts first.

    4. If you really want to get to something more like a native interface to the display, I'm not sure what will work.  It looks like Win32 DIrectX should be good enough. Take a look at this example using DirectX in Win32 on x86.  The performance figures are interesting.

     - Dennis



  • van_walraven

    the only problem i have with c# is that its not object oriented... ever since i started programming ive found that its a lot easier to work with objects(especially when it comes to possibly making games) in java what i was working on was a 3D game engine, the problem i had with it is i couldnt manipulate the screen directly and i had to do it through the graphics class(i later used the buffered image class which gives me about 3 FPS as the fastest update speed) which became a problem when i setup a parallel 2D array which i used to display certian colored pixels to the screen. im sure its not the best way to process an image but it seems to be the best way i can manage what is shown on the screen because using the graphics class gave me un-smooth images when they were shown, and the buffered image didnt work as fast as i wanted it to. i turned to c++ because i heard it was the best choice to handle these problems and since i alread had some experiance with it i figured it would be better that starting from the beggining from any other programming language

  • whinkle

    sosleepy wrote:
    the only problem i have with c# is that its not object oriented...
    ROFLZ! C# is object oriented. Same with Java, Native C++, Native C++ MFC, and C++/CLI.


  • de3a10

    The big difference is that Sun *owns* Java. There is more than one approach to GUI development in C++. I would say MFC is the best documented approach, and there are plenty of books you can buy here. Also, sites like www.codeproject.com have lots of tutorials and articles you can work through.

  • newbie to c++