views:

422

answers:

5

Is there a pdf or video or some media that can inform me on how to program Winforms with C++. Obviously C++ is the most common programming language and I already have some prior knowledge. But when I try to find media about programming in C++, the examples are usually Console applications. I want some media that can teach me how to program Winforms in C++.

+1  A: 

Bad idea, IMHO. Managed C++ is ugly; it was never meant to be a garbage-collected language. Its strength lies elsewhere. I recommend C# instead - similar syntax, highly marketable skill.

Preemtive snarky comment: all C++ is ugly.

Seva Alekseyev
Managed C++ is ugly - C++/CLI is much nicer, though. There's nothing wrong with doing Windows Forms from C++/CLI (WPF, though, is VERY tough in C++...)
Reed Copsey
+3  A: 

Here's a tutorial showing how to write Windows Forms applications in C++/CLI.

Just be aware that most samples tend to be in C#. Many people purposely use C# for the forms, C++ for their logic, and use C++/CLI to expose their logic as .NET assemblies (For easy use by C#/VB.NET). This helps, since the design-time experience is much nicer in C# or VB.NET for Windows Forms.

Reed Copsey
A: 

Just create a new C++ .NET project and start programming your C++. And additional syntax applies to .NET is managed pointers and .NET classes. Information about them you can find in MSDN, including lots of useful examples.

alemjerus
A: 

Well, there are opinions all over the place on this topic. My motto is always to use the right size hammer for the job-- and, in general, C++ is the wrong size hammer for making winforms. I love C++, but I only use it when there is an absolute necessity for speed of operations.

C# (or VB.Net, if you must) has MUCH better support for UI creation than C++, though I have noticed that Visual Studio 2010 offers some much needed enhancements to make developing Winforms easier in .NET 4.0. If you MUST stick with C++, look into obtaining a beta version of Visual Studio 2010. Otherwise, use C# as your UI, data access, file manipulation, general purpose language and C++ if you have to write a custom physics engine to go with it.

A: 

Have you looked at the MSDN articles? I'm not saying I recommend this, but they do at least give a start.

As far as Seva Alekseyev's comment that all C++ is ugly: it's like the old comment about democracy being the worst form of government except for all the others. He's right that all C++ is ugly, but fails to mention that all the alternatives are even worse.

Jerry Coffin
Don't get me wrong - I've used C++ for 12+ years, and I generally like it. Just making that comment before someone else does.Now let's all get together, sing kumbayah and flame on Objective C.
Seva Alekseyev