What is VB6's native UI design pattern? - vb6

We're rewriting an old VB6 app in .Net and WPF. I'm going to be helping some co-workers who support the old app get up to speed in WPF and MVVM. My background is in .Net and C# so I don't know VB6, but I'd like to understand where they're coming from. What is VB6's native design pattern (assuming it has one)? Looking at the code it looks like it might be MVC, but is that right?

Was the original program a desktop program or a web program (classic ASP)?
Frameworks:
Desktop VB6 programs are similar to .Net WinForms. WPF is going to seem strange. MVVM is likely to be unfamiliar.
Classic ASP. Fairly similar to PHP, but with a way to call up DLLs. So, like PHP, some people developed organised frameworks of their own, and others wrote spaghetti. [Can anyone improve on this part of my answer?]
Do your coworkers like reading? You could recommend
Dan Appleman's excellent book for ex-VB6 programmers Moving to VB .NET. Now ten years old, but still very insightful. It doesn't cover MVVM or WPF. It targets VB.Net rather than C#, but most of it is still relevant.
Microsoft Visual Basic 6.0 Migration Resource Center (an excellent resource)
Other things to bear in mind: VB6 is an object-based language (it has objects, polymorphism, and interface inheritance through Implements, but no implementation inheritance). It is event-based, like .Net. Object lifetimes are deterministic because it uses reference counting. There are no generics.

It uses no design pattern. As a language, VB6 is a general one. The IDE and framework uses RAD approach, in procedural event driven style. The same thing applies to C#, except it uses object oriented event driven instead.

I have made an attempt to explain MVVM using VB6 here.
One tip I will like to add is with VB6 migration projects it is always best to refactor/modify code before hand. Although VB6 to VB.net conversion wizard in visual studio does a good job but there are too many pain points. Avoiding them by modifying VB6 is lot easier than fixing the issues in VB.net.

Related

How to start programming in Windows? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I've made simple programs in C and C++ with simple compilers (learned it in university; I'm Statistics student). Also I'm amateur PHP programer.
Now I want to start programming for Windows.
apps with user interface
apps without user interface
My aim is just to see how it is done. And I might make a basic app that interacts with a database which is in a web server.
Where should I start? Windows Visual Studio? .NET? What should I know?
If you actually want to learn the underlying API then you should start off without one of the frameworks.
Learn it the way we did it all those years ago with Charles Petzold's book, Programming Windows. A really good foundation of knowledge of how windows and messages work will serve you well.
In the longer term, a good framework, e.g. WinForms, Qt, VCL etc. will increase productivity. But if you start with one of them, then you are in danger of not knowing the difference between sent and queued messages, not knowing the difference between an HWND, an HDC and a HANDLE, and so on.
A good framework, is great, but you'll get more out of it if you understand what's underneath it.
See this question:
C# GUI programming for beginners: Where to start?
Especially this answer there.
I think you should start with Windows Form, WPF is the new thing for Windows Dev and its getting all the lime light, but I would really not recommend starting off with it.
Get Visual Studio 2010 Express
See this MSDN page on Windows Forms
Programming Windows Forms by Charles Petzold is nice book (Charles is very cool) , windows forms hasn't changed all too much since Visual 2005, you should learn C# 4, the latest language.
Visual C# 2010 Step by Step is a good book to get a gist of the .NET world and all your options (including WPF)
See these SO questions:
Beginners book for .NET and C#?
https://stackoverflow.com/questions/4807574/best-c-programing-books-for-absolute-beginner-or-someone-just-starting-with-net
https://stackoverflow.com/questions/52926/beginning-c
Hope that helps.
Update
Incase you were thinking of going with C or C++ for windows development, is it not easy. I've done some Win32 API and believe me you'll be writing seriously long/complicated programs for even simple things
You have two MS options, you can just use the C or C++ language and call the Win32 API functions.
This book is the Bible for that.
The other MS option is using MFC, people have some rather strong (bad) views about MFC. I haven't done much of it myself so can't say too much.
See : https://stackoverflow.com/questions/557114/stick-with-mfc-or-go-to-net
There are of course tons of non-MS options, which again I wouldn't recommend.
See : Native Windows Application Development Options
Bottom line, in my opinion, C# is a very well done language, you will get TONs of support here, Visual Studio is one of the best tools around, and you will have fun learning C#/.NET, and the biggest advantage is you can use your C# knowledge to write even Web Apps, Cloud and Mobile apps and lots more.
I'm not sure why people don't use cross-platform GUI toolkits more often. I tend to write my GUI in Java, and transfer control over to C++ for the actual program logic. If you know about the MVC architectural pattern, you can use Java to implement the view and controller, and C++ to implement the view. If the program is simple and performance isn't critical, then I often code everything directly in Java. I've listed a few pros of cons of using Java for coding UI instead to other languages below.
Pros
Java already has a large library full of useful utilities, and is a good starting point from which one may learn other languages. There's many well-tested Swing components that are ready to use, and tutorials online that give you good starting points for many common use cases.
Check out the JogAmp website, and try out their demos. I prefer using C/C++ to do the rendering and Java only for the user-interface, but if performance is not critical, the JogAmp APIs a lot of flexibility in terms of controlling which subset of OpenGL you would like to use.
Java has extensive support for databases and servlets - check out the JDBC API.
Java is open-source, and does not restrict you to using a particular IDE (or operating system!).
Java comes with a builtin documentation generator called Javadoc, and it works really well. In fact, documentation for the JDK is generated using it.
Cons
Java is an interpreted language, so performance will typically be worse than that of other compiled languages.
Java forces you to frame your entire program logic using objected-oriented principles, even when they aren't a good fit for your particular use case (e.g. simple, one-off experiments). Sometimes your code can end up being much more verbose than it needs to be in order to accomplish a particular task.
Edit: There are plenty of resources for beginners, such as this one.
I'm going to go out on a limb and recommend C# using Visual Studio 2010 C# Express. It keeps you familiar with the C/C++ style your probably familiar with.
There are various sample codes available for download. I found them very helpful when I was starting to learn to program for windows phone.
Visual Studio works great for C#. You should probably consider creating an account with microsoft whether via outlook.com if you plan on publishing what you develop.
If you want to develop for windows 8, I would advise that you install windows 8 and develop using that.
I think you can start with C#.net and then ASP.net

What are the disadvantages of using Visual Basic 6? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I hear that Visual Basic 6 is not good.
I want to make very generic program. Would Visual Basic 6 suffice?
The very first reason is that Microsoft no longer offers support for VB6 development. This product is end of life.
http://support.microsoft.com/lifecycle/?p1=2971
http://msdn.microsoft.com/en-us/vstudio/ms788708
It worked well in its time, but it doesn't have a simple path forward. If you want to migrate to a newer version of Visual Basic, it can be a fair bit of work. And no new tools are being developed for it.
If your major interest is in a cheap VB development environment, as previously mentioned, the Visual Studio Express editions are free from Microsoft.
I can't think of many good reasons to use VB6 instead of one of the express versions. Also as previously noted whatever VB skills you learn won't be particularly portable and the apps you build won't be able easily to migrate to more up-to-date environments.
I will also have a look at Real Basic. It is a cross-compiler and your applications will run on different platforms. There are many options available in the market. It all depends on what your definition of "generic program" is.
Real Basic
I have ever listen bad comments about Visual Basic 6 programming, I have written thousands of VB6 lines of code, in the same manner I have written code in object oriented languages (C++, C#, Java). But It seems to me that VB6 is a very good programming language, because it allows you to write powerful-simple applications. VB6 syntax is easier that C/C++ syntax but C#/Java aren't so much difficult that VB6. Also developing enterprise application is such new languages (Java, C#, VB.Net, Rubby) is easier that VB6 because they rely on Frameworks, every body can write C#/Java code that function, but it requires, tricks, good practices and some of imagination to write VB6 strong and rehusable code.
Many developers become quickly frustrating by using VB6 and then are happy programmers using C#/Java. All depends on practices and discipline there is no bad language, each language was designed with some purposes on mind, by selecting the appropriate language, problems solving could be easier.
Forget VB6. It's a dead system. No support, no future. Use the Visual Basic Express Edition, as suggested above. It's free, useful, and about as "generic" as it gets anymore.
Or, you could use something even better: Python (www.python.org). Or IronPython. (www.codeplex.com/IronPython).
Much better system.
If you are approaching the programming world, and you want to do some programs, Visual Basic is more than sufficient.
Once you learned it, you will keep to use it.
As Visual Basic Express (which is the version that was before called Visual Basic .NET) is given free from Microsoft, maybe you could be interested in that.
Depending on what you mean by "Generic Programs" there are plenty of other environments/languages that you can create simple apps with, even at no cost.
Visual Basic is old and no longer supported by Microsoft, sounds like you may just have access to a copy.
Yes you certainly can create generic programs with it, but where do you go from there? Is this hobby programming?
I'd say VB6 is still ok for (throw away) prototyping and probably better than VB.NET in that regard. A larger problem is the lack of true inheritance and being able to use the idioms available in .NET. As such it makes writing clean and maintainable code more difficult.
even bill gates wont suggest you to use it!! they stopped its support to make migration to newer versions faster. So now dont go and start a new project in a dead language. also there is no backward compatibility.
Like others have said, Microsoft's support for VB6 has been discontinued. But no company "supports" C, so I would say that's not really a reason inherent to the language.
Another reason is support for objected oriented programming, which may or may not be important to you. To me, it is.
VB6 is handicapped in this area. It doesn't really support interfaces. Also, arrays are some pain to work with. Checking whether an array has been properly intialized (a fairely trivial task, imho) involves some workarounds. It's not as simple as
If myArray Is Not Nothing Then ...
If you already know some Visual Basic syntax, then switching to VB.NET shouldn't be hard. You'll just have learn your way around the framework class library.
If someone tell you for any language the it's "not good" then just erase this person from your contact list.
There no good/bad languages. Horses for the courses.
As for disadvantages - you'll find such in any language.
vb 6 is very good to approach the programmation with object and to know basic structure of programming . If you understand one language you CAN know the other. Is not important only the programm language, but the FLOW of data.
Check out Xojo as a modern replacement for Visual Basic. It is as easy to use as VB6, but also build cross-platform desktop apps, web apps and iOS apps.
As far as beginner programming is concerned, I suggest to start playing around with VB6, for its BASIC programming style, GUI that is not so complicated, and a bunch of code is available online. I myself start coding using VB6.
But honest advice, if you want to find a job, start learning C++, C#, JAVA, HTML, PHP, and better yet, ANDROID DEVELOPMENT.
Even if VB6 is not suitable for our life today, you can still stick to its new generation: VISUAL STUDIO - which offers a more complex GUI, yet more flexible platform. It offers VB.NET, C# and creates your own Database with powerful connection.
Just want to thank VB6 for teaching me how to code!

Do you use Data-aware classes?

I'm using VB6.
Data-aware classes refers to classes whose DataBindingBehavior or DataSourceBehavior property is set.
I learned this concept from MSDN and am wondering usually when should we use this technique of Data-aware classes? Or just like the Data Environment Designer which is just ignored by most developers?
The ability to create data-aware classes is just another aspect of Visual Basic's extensibility model. Along with the ability to create standard Classes and UserControls, you can create them as data-aware classes that can plug into VB's data binding mechanism.
You can wrap something like an ADO Recordset or ADO Data Control to create a more application-specific component, or you can create your own from scratch to provide data binding for some sort of out of the ordinary data. You can even create basic custom OLE DB Providers for unusual requirements by writing VB6 data aware classes in conjunction with the OLE DB Simple Provider (OSP) Toolkit.
Most of these things are rarely used today, because VB6 education is sorely lacking. A lot of programmers who learned by example shy away from data binding because they've found it frustrating. Most of this is a lack of understanding though. Instead we fall back on writing a lot of QBasic-like procedural code that sacrifices the power of VB6 event based programming.
You'll see the same thing in a lot of VB.Net and C# code loose in the wild. People seem unaware that event driven programming is actually much more important than the degree of "OOPiness" yet that's where the focus seems to be.
Programmers who understand the importance of this tend to have a lot fewer DoEvents loops in their VB6 programs and almost no gratuitous multithreading in their .Net programs.
I am as guilty as anyone of avoiding the Data Environment Designer and bound controls. I plan to become more aware of their use and capabilities though as well as making more use of VB6's Data Report Designer. These are powerful tools for writing data-centric programs, something I'm doing a lot more of lately.
There is no argument that Microsoft has dropped all support for VB6 development. But this doesn't say anything about the demand for it, which continues to be strong. If people have little to contribute to answering a question about VB6 they might spend their effort better elsewhere instead of shouting it down here. It is very sad that we never got a follow-on product - a newer VB supporting 64-bit development would be really nice. It just isn't in the cards.
Do you have any idea how old VB6 is? It's about ten years old. You should pretty well ignore anything you "learn" from VB6.
Some resources on VB6:
Support Statement for Visual Basic 6.0 on Windows Vista, Windows Server 2008 and Windows 7
Visual Basic 6.0 Resource Center (I didn't think such a thing existed)
Visual Basic History (I was right. October 1998)
Migration - Upgrading from Visual Basic 6.0
Product Family Life-Cycle Guidelines for Visual Basic 6.0 (it is unsupported as of March 2008):
Support will no longer be offered for Visual Basic 6.0 after nine years of general product availability.
Visual Basic 6.0 will no longer be supported starting March 2008.
All of this is from the following search: http://social.msdn.microsoft.com/Search/en-US/?Refinement=22&Query=vb6.
I think that feature has been ignored by most VB6 developers. Certainly I experimented with it once and never used it again. If you Google DataBindingBehavior or DataSourceBehavior there are relatively few hits.
I think what John is trying to communicate in his answer is that VB6 is not a good choice for new development unless you have strong reasons to the contrary - for example if your organisation already has a lot of VB6 experience and a lot of VB6 code to maintain, and no experience of other desktop programming languages. That sounds unlikely in your case, otherwise you'd be asking your colleagues the question rather than posting on Stack Overflow!

Easier than Visual Basic 6?

Some years ago I used to program in VB6, I really liked it because it was very simply and fast, when VB.net came out, I abandoned it because they changed a lot of things.
I wonder if after all this years there's a new language or IDE that helps programming in an easier and faster way than VB6.
I'm not very interested in academic/personal issues like, very high performance, great movility through OSs, open source, etc. I would like to know if there's is something to program small and medium desktop apps. in an very easy and fast way.
Excuse me if my english isn't very clear.
Edit answering Nicholas:
Well, I must admit that I didn't try VB.Net too much, I was a little disappointed because I would had to learn a lot of new things and I've had learned VB6 not so long before (in that moment).
VB.Net is the natural progression of VB6, and has a lot of free tools and resources online to get started. Microsoft even provides a free development environment as well as a free database for development/bundling in your applications.
Check out this website for information and download links on all the free Microsoft software.
Also, you said you tried VB.Net and didn't like it-- I'd be curious to know why? Yes, there's a little learning curve, but the abundance of getting started information on the internet surely can help that. I was a bit overwhelmed by .NET at first (particularly ASP.Net) not seeing the value in switching/learning a new language.
I always felt Microsoft Access was far and away the best for this kind of requirement.
edit - I realize this isn't a politically correct answer. But the total package of a built in DB, a great GUI development package, a great report generator (far superior to crystal reports, for example), the easy development of tables and queries, all put in one friendly package, make it nearly trivial to develop with. For rapid development, it's the best I've used.
FWIW, I do Java, C++, C, VB4/6, ASP, JSP, Perl, PHP, CSS/ DHTML, JavaScript, Pascal, Fortran, Kenemy and Kurtz Basic, BAL, unix shell scripting, Oracle, mySql, RPG III, COBOL, some proprietary stuff, various macros, various distributed technology, Job control language, CPL, etc. etc. I got out of developing in Access because of scalability limitations.
Powerbasic may be to your liking -
http://www.powerbasic.com/
One of the easiest languages to learn and use is Python.
FLEX / AS3 / MXML / AIR (tnx le dorfier) comes very close to that VB6 feel from many years ago. But understands stuff like CSS and produces output that works in browsers on any platform (or desktop with AIR). You write code and run it, the coding cycle is very fast. And AS3 is at least as powerful as VB6 ever was, plus there are myriad add-ons and libraries to support all sorts of applications, all the major web-services, database interface, animation, video, 3D, auto-generation of PHP code, etc.etc.etc...
And Flex Builder 3 is free for students and educators.
alt text http://www.infoworld.com/infoworld/img/17TC-adobe-flex-builder.jpg
Python or Ruby.
Dynamic languages has a number of advantages (and disadvantages) but for what you propose they seem perfect.
I would recommend python or ruby bindings of a high level toolkit as a perfect environment. For instance Qt library gives most functionality you would need and dynamic languages let you easy experimentation
Microsoft has a new dialect of BASIC called Small Basic. From the website:
Small Basic is ... a small and easy to learn
programming language in a friendly and
inviting development environment,
Small Basic makes programming a
breeze. ...
Small Basic derives its inspiration
from the original BASIC programming
language, and is based on the
Microsoft .NET platform. It is really
small with just 15 keywords ...
The Small Basic development
environment ...provides
powerful modern environment features
like Intellisenseā„¢ ...
The first two versions of VB.NET had serious shortcomings compared to Visual Basic 6. However most of these issues has been fixed since Visual Studio 2005. Today, for new projects, I feel that everything that made VB6 so easy to use is available with VB.NET plus you get new language constructs, and the .NET framework. There also refactoring, and the VB Power Pak which brings back the older simple to use print engine.
Of course there is a learning curve involved. But no more than the leap from QuickBASIC/PDS to VB 1. If you have to maintain or transfer an older project then the differences between VB6 and VB.NET are much more serious.
Finally there is the Mono Project which support the VB compiler. This provides a degree of relative immunity from Microsoft deciding to break backwards again.
You could try FreeBASIC.
It's syntax is very similar to that of VB and it is an actively worked on open-source project, it is also portable across different platforms.
You can grab a download here and there are several exemplary works that can be found here.
If it already wasn't done I'd recommend python. It's one of the easiest languages to learn.
My first language was Pascal and I think it's also one of the easiest languages and with Delphi getting popular again I think it's a very good alternative to VB6.
I've always found Delphi to be easier than VB despite popular belief.
take a look at Lua
very small core language, the whole documentation is a single (very readable) webpage. you can easily learn the basics in a weekend.
very good (small) books with good tips.
very helpful community.
very fast, both with the standard bytecode VM, and the JIT.
used a lot in games, both because it's fast and easy to embed in the application, and because it's easy to explain to players interested in extending the game.
readable sources.
MIT license, use for whatever you like, no strings attached.
Perhaps Clarion is what you're looking for? Personally, I don't have much experience with it, but you can build some nice apps with virtually no coding skills.
I think C# is a very good language to program GUI apps quick and easy.
While this might not be a complete answer to your question, I would recommend spending some time learning a more complex language (Objective-C, Java, C#, etc). With the experience you learn with OOP design patters etc, in the future you won't have to shop around for the "easiest" language to program with.
visual basic.NET is much more easier and have complete features than VB6 as I've experienced.
I recently messed around with Microsoft Lightswitch and found it extremely VB like. Very fast for binding to a database and generating forms, grids, etc.
More than 10 years after this question was asked, the best answer is...
...to continue using the VB6 programming language.
VB6 still works on Windows 10 and Windows Server 2019. Just as it has since Windows 98.
Microsoft's support policy for VB6 is here VB6 support policy

Where is a good place to start programming GUIs for windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have experience writing console and network client/server applications in C and C++, but I know next to nothing about using the win32 visual API, MFC, Qt, wxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robust?
This is a rather broad question, as programming GUI applications in Windows can be done in so many ways.
There are two main parts to developing any GUI app: the language and the API/framework. Considering you're interested in learning to build Windows GUI apps, the language isn't really a point of focus for you. Hence, you should pick a language you already know and work with a framework or API that can be harnessed by your chosen language.
If you want to use C you're pretty much restricted to dealing with the Win32 API yourself, in which case reading Petzold or Richter would be great places to start. The Win32 API can be quite daunting, but it's well worth the effort to learn (imho). There are plenty of tutorials on Win32 on the web, and there's always MSDN, with a complete reference/guide to the Win32 API. Make sure you cover not just the API, but other areas such as resources/dialogs as they are building blocks for your Win32 application.
If you want to use C++ you have all of the options that you have when using C plus a few others. I'd recommend going with the Win32 API directly, and then moving on to a known framework such as MFC, Qt, wxWindows or GTK so that you can spend less time working with boilerplate code and instead focus on writing your application logic. The last 3 options I just listed have the added benefit of being cross-platform, so you don't have to worry too much about platform-specific issues. Given that you said you want to work with Windows, I'll assume you're keen to focus on that rather than cross-platform -- so go with MFC, but spend some time with the Win32 API first to get familiar with some of the concepts.
When dealing with MFC and the Win32 API, it's a good idea to try and get a solid understanding of the terminology prior to writing code. For example, you need to understand what the message pump is, and how it works. You need to know about concepts such as "owner-drawn controls", and subclassing. When you understand these things (and more), you'll find it easier to work with MFC because it uses similar terminology in its class interfaces (eg. you need to know what "translate messages" means before you can understand how and when to use PreTranslateMessage).
You could also use Managed C++ to write .NET GUI applications, but I've read in a few places that Managed C++ wasn't really intended to be used in this manner. Instead it should be used as a gateway between native/unmanaged code and managed code. If you're using .NET it's best to use a .NET language such as VB.NET or C# to build your GUIs.
So if you are going to use .NET, you currently have the choice of the WinForms library, or WPF. I personally feel that you'd be wasting time learning to build WinForms applications given that WPF is designed to replace it. Over time WPF will become more prevelant and Winforms will most likely die off. WPF has a much richer API set, and doesn't suffer from many of the limitations that Winforms does. If you do choose this route, however, you'll no doubt have to learn XAML, which is a markup language that drives WPF applications. This technology is coming of age, and there are many great places to learn about it. First, there are sites such as LearnWPF, and DrWPF which have some really great articles. Secondly, there are plenty of quality books on the topic.
So, to sum up, once you've picked your language and tech, the path is actually quite easy. Just pick up a book or two, read some blogs, get into some code samples.. and most importantly ... write code. Keep writing, keep making mistakes, and keep learning from them.
As a final note...
In other words, Silverlight. If you don't want to go the MS route you might give Adobe's Flash/Flex a look see. Both Silverlight and Flash/Flex build RIA's. Which I think is where we are headed. They days of Office like apps are numbered
I don't agree at all. Silverlight is not the same as WPF. Silverlight is web-specific, and only has a subset of WPF's features. Given that the question asks for Windows GUI apps, Flash/Flex Rich Internet Apps are not really a fitting suggestion. I also don't agree that the days of Rich Client Applications (such as office) are numbered at all.
I hope that helps. Good luck :)
I don't know if I'd call it a good place to start, but if you want to be future ready, take a look at the windows presentation foundation which is built entirely for the purpose of programming GUI's for windows
My first experience writing simple GUI applications for Windows was with C# and Visual Studio. The GUI-building interface is a simple drag and drop deal that generates skeleton methods based on potential user actions. I only did fairly basic programming with this, but I imagine it would be an excellent place to start to learn the basics and extend into the more advanced capabilities as you go.
There are plenty of online Win32 tutorials:
http://www.zeusedit.com/forum/viewtopic.php?t=1218
There are plenty of compilers to choose from:
http://www.zeusedit.com/forum/viewtopic.php?t=238
I would also recommend getting the Borland Win32 SDK documentation in WinHelp file format:
http://www.zeusedit.com/forum/viewtopic.php?t=7
It only covers the bare basics of the Win32, but when starting, this can be helpful as it is less daunting and less bloated than the MSDN.
I'd never go down the Silverlight, Flash/Flex or any similar route. It does look nice, but the main problem is that the code of the engine that runs it is completely closed-box and controlled by a single company. Take, for example 64bit versions of both of those. If some new platform emerges, you won't be able to migrate your existing code to it.
For business apps, Windows Forms is very mature. It provides a gentle path from auto-generating a lot for you into allowing fine-grained control and rolling your own. There are tons of high-quality third party controls and a large body of examples, docs, etc out there. It's hard to run into a problem that someone else hasn't solved. I highly recommend acquiring some background Win32 knowledge (e.g. Petzold) as the WinForms framework lives on top of it.
I have no WPF experience, but from the sample apps I've seen it looks like a good choice for apps whose interfaces would benefit from more graphical metaphors. So if you're doing a banking app, probably not worth the extra design overhead. But if you're doing, say, a warehouse management app it could be improved by dropping pretty boxes into pretty bins.
#StephenCox: wrong answer to the wrong question. OP is asking about desktop client apps, and moreover, WPF != Silverlight.
For a simple starting point to get your head around the "event-driven" nature basically all frameworks are created around look at FLTK.
Here are some quick starting videos Link
For professional use I'd recommend Qt, expensive but often worth it in commercial situations.
Since you are already familiar with C and C++ I would recommend learning how to write a simple Windows GUI app using Charles Petzold's book. It will give you the fundamental understanding of how Windows works. It's good to understand that most everything that you see is a window (a button is a window for example) and that these windows respond to messages. I wouldnt' spend a lot of time on this though and you don't necessarily need to do this first if you are going to chose WPF. I just think it's good to have a basic understanding of this.
There was a good podcast recently on .Net Rocks called "Kate Gregory Develops in C++ for Vista!" on there she recommends that someone starting out now should not use/learn MFC (even though it has been recently updated).
As far as getting ready for the future you need to learn WPF, but it isn't complete yet, so depending on the kinds of client side apps you want to create, you will probably need to learn WinForms. The majority of people aren't using WPF yet, so it's a good time to start learning. I think you will find it easier using C# to learn it instead of doing managed code with C++.
Get your basics right first. Best tutorial I've found is: http://winprog.org/tutorial/start.html
After that, although the homepage is hatefully distasteful, the tutorial pages are good in content and aesthetics: http://www.tenouk.com/cplusmfcdotnet.html
Then of course there's MSDN.

Resources