views:

890

answers:

9
+5  Q: 

C++/CLI Books

Can anyone recommend any specific books on C++/CLI, particularly with reference to .NET and Visual Studio. It seems to me that there is very little out there, a few APress books with a couple of comments each on amazon. I'm looking in particular for something that isn't an introduction to C++, but something more Microsoft specific.

Thanks.

mintydog

A: 

Ivor Horton's Beginning Visual C++ 2008 - C++ in general and C++/CLI specific

And of course: Learn Visual C++

macropas
I found Horton's Beginning VC++ 2008 to be borderline useless for the CLI-related stuff.
Toybuilder
+3  A: 

Microsoft seems to be positioning C++/CLI as an upgrade path for existing Native C++ projects to integrate with the .NET ecosystem. As such, new project development in the language isn't actively pushed. With that in mind, and given the complexity of C++ proper without considering the .NET extensions, it will probably be a challenge to jump into C++/CLI directly. I would probably pick up a C++ primer first, then a basic C# book for its introduction to the ".NET way", and finally read Microsoft's documentation on C++ which will contextualize what you read in the C# book in terms of what you know in C++.

Eugene Talagrand
Yes, that's very much the view I'm getting, with Microsoft not pushing it so much as a language in itself, I agree.
Ray Hidayat
+5  A: 

Be sure to check out C++/CLI In Action if you're planning on integrating C++/CLI code into an existing C++ project.

Shog9
You should also read the authors blog at blog.voidnish.com
Martin Beckett
Second that recommendation, I just finished a major port that relies on C++/CLI and we use it heavily for interop in my current job. Nish's book has been a huge help for some fine details.
Andy Dent
A: 

Check out Windows via C/C++ from Microsoft Press.

Tuminoid
A: 

Foundations of C++/CLI is a decent book. It methodically describes all aspects of the C++/CLI language. Beside other things it also has examples of using STL/CLR, which is an STL-like library recently added to C++/CLI. I think you won't be mistaken if you choose this book. I would also recommend you to visit your local Barnes and Noble store and check the book out before you buy.

alexeiz
+1  A: 

If You start doing anything related to "native vs .NET" C++ InterOp, you'll notice that most articles you google out about that subject are written by Nishant Sivakumar.

He also wrote a must-have-as-a-reference book Shog9 recommended "C++/CLI In Action".

If needed: Since it's totally CLI dedicated, it's totally Microsoft specific :)

Jox
+2  A: 

Of the various books I've tried so far, I found the Apress Pro C++/CLI and the .Net 3.5 Platform to be the one that I used the most. Horton's Beginning Visual C++ 2008 was, IMHO, next to useless for the CLI aspects.

Since you're interested in CLI, I think it's safe to say that you're really interested in making use of the .Net framework. For that, the various C# resources out there will help immensely -- the calls into the framework under C# maps to C++/CLI -- you just use gcnew's, the handle operator (^, instead of *), and the :: operator instead of the dot (.) operator from C#. If you spend some time looking at MSDN help pages, and compare the C# and C++ example codes, you'll see that they're usually "identical" after these substitutions.

Toybuilder
+3  A: 

The Apress Pro book is very good, as is C++ in action (especially for mastering marshal_as template's for high performance native to managed type importing).

I think a newer title Expert C++/CLI: .NET for Visual C++ Programmers, is very, very good. Especially for low-level specifics on aspect's of intialization and hosting possibilities, it even contain's matrix's of "If you are linking Debug DLL... x, y, z.."

If you dont have this book currently, and are doing a substantional amount of C++/CLI work, and really want to excersize the full gambit of API available (if nessissary), it's a must-read. If you do not have this book, dig through the source code for the CRT that's shipped in VC 2010, perticualarly the code files for delayload support and other managed<->native thunk's.

RandomNickName42
+1: Thanks - that looks rather handy..
Jon Cage