CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 41
  1. #16
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to learn c++/cli?

    Did you install c++/cli support when you installed VS (it's separate from c++)? If not, you'll need to install this from VS Installer.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  2. #17
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: How to learn c++/cli?

    Thanks 2kaud - I just installed the option for C++/CLI and I'm now seeing C++/CLI support for v142 build tools (14.2.3) listed among my installed options. However... I still don't see any way to create a C++/CLI project. I do see an option to create a CLR Empty Project but I'm not sure if that's the same thing (and in any case, I think that one was already there previously)
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  3. #18
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to learn c++/cli?

    For project templates, you should have CLR Empty project, CLR Console App, CLR Class Library. That's what I get with my VS2019 installation.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  4. #19
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: How to learn c++/cli?

    Thanks 2kaud - so if I wanted to start with a simple "Hello World" app (i.e. using a GUI window) there isn't an option that'll start me off with the basic code?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  5. #20
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to learn c++/cli?

    John, what's the goal here? Is it to learn .net programming? If so, I wouldn't recommend going the C++/CLI route, because this language isn't kept current as the other languages are. For example, 2kaud mentioned the 3 new project types for C++/CLI. For comparison, C# has about 50 different new project types.

  6. #21
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: How to learn c++/cli?

    Hi Arjay - I work on a large software project that's written in C++. When I first started with it (10 years ago) we were building with Visual C++. But the vendor needed to go cross-platform so I've had to move to gcc. For me, the problem with gcc is its debugger which isn't a patch on Visual C++'s debugger. So I just wondered if there's some quirk I could use to get Visual Studio back into the picture somehow.

    Some of Microsoft's other languages have made great strides in targetting other platforms but VC++ seems to be staunchly stuck in the stone age. It's a huge shame IMHO. VC++ is a great development tool but the fact that it'll only target Windows makes it very difficult to justify any more for serious development....
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  7. #22
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to learn c++/cli?

    .Net Core is cross platform and with C# you have the option of building many different types of apps that aren't available in C++/CLI.

  8. #23
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: How to learn c++/cli?

    The project's way too big to convert everything to C#

    My memory's a bit hazy on all this but when I last looked into this a few years ago, C# could incorporate modules written in something called "Managed C++". But AFAIK Managed C++ is obsolete now (replace by C++/CLI?). I don't think C# could incorporate ordinary (unmanaged) C++ though.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  9. #24
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to learn c++/cli?

    Think of c++/cli as Managed C++ v2. Managed C++ was MS first attempt at enabling C++ to use .net. After it was released and started to be used from the feedback received MS came out with C++/cli which replaced Managed C++ but with the same objective of allowing C++ to use .net.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  10. #25
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to learn c++/cli?

    Quote Originally Posted by John E View Post
    Thanks 2kaud - so if I wanted to start with a simple "Hello World" app (i.e. using a GUI window) there isn't an option that'll start me off with the basic code?
    Search www.codeproject.com for c++/cli. There are various examples of learning and using c++/cli.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  11. #26
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to learn c++/cli?

    Note that AFAIK converting a pure c++ program to c++/cli that uses .net isn't straight forward. One of the issues is that .net uses managed memory and c++ doesn't. That's why in c++/cli code you see ^ (boxing) applied to variables to indicate that these are .net managed variables etc etc etc.

    Have a read of http://www.gotw.ca/publications/C++CLIRationale.pdf by Herb Sutter (designer of the language).
    Last edited by 2kaud; October 14th, 2019 at 04:33 AM.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  12. #27
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: How to learn c++/cli?

    Quote Originally Posted by 2kaud View Post
    Search www.codeproject.com for c++/cli. There are various examples of learning and using c++/cli.
    Thanks 2kaud - I ended up downloading this sample project (the one called Hello C++/CLI project)

    When I build the downloaded project it all builds fine - but if I copy its source files into the empty project I created yesterday I see compiler errors like these) :-

    Code:
    name followed by '::' must be a class or namespace name
    'Windows': is not a member of 'System'
    'Forms': is not a member of 'System'
    'MessageBox': is not a member of 'System'
    [Edit...] I fixed it. I needed to add a couple of References to my project (System and System.Windows.Forms)
    Last edited by John E; October 14th, 2019 at 07:46 AM.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  13. #28
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to learn c++/cli?

    It pains me to see you starting to learn nearly 20 year old technology, i.e., System.Windows.Forms.

  14. #29
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: How to learn c++/cli?

    Yeah, I'm beginning to realise this is all a bit pointless...

    The only real solution is for Microsoft to bring out a cross-platform version of VC++ (gcc managed it more than a decade ago so I'm surprised that MS can't)
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  15. #30
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to learn c++/cli?

    Quote Originally Posted by John E View Post
    Yeah, I'm beginning to realise this is all a bit pointless...

    The only real solution is for Microsoft to bring out a cross-platform version of VC++ (gcc managed it more than a decade ago so I'm surprised that MS can't)
    Technically, MS of course could. Marketing/Politically is a different issue!
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

Page 2 of 3 FirstFirst 123 LastLast

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