CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 38

Threaded View

  1. #11
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Trying to create a vector using a structure definition as the basis in VC++

    I don't want to interfere with all the things that already have been stated correctly, but I think I should clarify (at least superficially) some things about the relation between native C++ and managed C++ (IOW C++/CLI) before even more confusion arises...

    Quote Originally Posted by 2kaud View Post
    If Friedman is the name of the "solution/project" then this is not a namespace and hence

    using namespace Friedman;

    is incorrect and should not be included.
    That's not exactly true for Windows Forms application projects. When the VC++ IDE sets up such a project, it creates a namespace with the same name as the as the project. I usually call that the "application namespace", but I think that's by no means an official term. The main form class (Form1) is defined in that namespace, but for any other classes (except for forms created by the IDE), the developers need to take care of that themselves.

    Quote Originally Posted by Paul McKenzie View Post
    How are you going to learn the advanced topics if you don't know the basics, such as namespaces? You can't cherry-pick certain topics in C++ and expect to get anything useful done. You have to know the basics before going on to do anything else in C++.

    [...]
    So true, so true... While not even native C++ really is a language meant for beginners, C++/CLI is even less. One might say that C++ is a language for those who know what they're doing, and C++/CLI is one for those who know even better. (By which I don't mean to say that C++/CLI is in any way superior to native C++. But it definitely is more demanding in some aspects.)

    One word directly to the OP, Protocol: MFC is sort of the canonical way of writing native C++ Windows GUI apps, but the Express Edition doesn't provide that. So the only way to write Windows GUI applications with the Express, except for Petzold-Style raw Win32 programming (rather tideous) or 3rd-party libraries, is Windows Forms. But if you pick that, stick with it. Mixing managed and native code in C++/CLI is possible, and in fact the probably primary advantage of C++/CLI, but it's strongly discouraged unless you have a really good reason to do that, especially for beginners. Such combinations result in "interop scenarios" which can be really, really advanced and cause unexpected and complicated difficulties.

    If you make your decision for Windows Forms and C++/CLI, feel free to post in the dedicated forum section. But, as already mentioned, I strongly recommend against mixing that with native C++ without a good reason.
    Last edited by Eri523; January 27th, 2013 at 11:41 PM. Reason: Small but important semantic fix
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured