C# vs. Visual C++\MFC

Started by
28 comments, last by Buklenios 18 years, 2 months ago
Quote:Original post by Ancient Spirit
So what you recommend is not to mess with the choices but learn them both?

Well, all windowing toolkits are based on the same basic principles - handles, messages, queues, threads, events. If you're going .NET, Windows Forms is the technology for right now, and WPF is the technology for next year and beyond. If you're sticking to C++, MFC is widely used, but it's basically a wrapper around Win32, so learn Win32 and it'll be applicable to more areas.

Note, however, that MFC makes some Win32 GUI tasks much simpler, so if you plan to do heavy GUI work in C++ and a wrapper is not an option, definitely learn MFC.

Quote:EDIT: Windows Presentation Foundation, what lang is it based on and ummm... is there a point of learning MFC then? I mean for jobs and stuff...

WPF is a .NET technology, so it's language-agnostic. I don't see that many MFC job postings anymore, but, then again, I don't look so often.
Advertisement
Quote:Original post by Ancient Spirit
My problem is that I don't really want to learn new langs nowm...

These are much simpler languages to learn and use than C++ (which is horridly complex). Plus, with the tools from Microsoft, you don't have to write the GUI code from scratch, just the event handlers.
Microsoft give me a headache... So basically if I want to stick to C++ MFC is the way? Is GUI the only thing that is easier to do with MFC? What about system programming stuff, like the kernel and what about threads? (never used threads and kernel on Win32 SDK, I only wrote a bit GUI on the SDK and a fullscreen opengl window).

EDIT: it took me a while to learn C\C++, and now I should forget it all if I want to be a Windows programmer?
This world is ruled by big furry CATS!! :)Meow! :)
Quote:Original post by Ancient Spirit
So basically if I want to stick to C++ MFC is the way?

No, it's a judgment call. Ultimately, you have to make up your mind for yourself.

Quote:Is GUI the only thing that is easier to do with MFC? What about system programming stuff, like the kernel and what about threads? (never used threads and kernel on Win32 SDK, I only wrote a bit GUI on the SDK and a fullscreen opengl window).

GUI has nothing to do with the kernel, thankfully. MFC does wrap threads, but largely to facilitate writing GUI code. But if you're writing threaded code for non-GUI purposes, introducing the overhead of MFC is not worth it.

Quote:EDIT: it took me a while to learn C\C++, and now I should forget it all if I want to be a Windows programmer?

If you think you'll only ever need one programming language, you are sorely mistaken. Learn as much as you can.
You know, C++/CLI is an option for you. It takes advantage of WinForms and stuff, and allows you to still write unmanaged code (ie, C++ code.) Think of it like C++ with full access to the .NET runtime.
Quote:Original post by Flimflam
You know, C++/CLI is an option for you. It takes advantage of WinForms and stuff, and allows you to still write unmanaged code (ie, C++ code.) Think of it like C++ with full access to the .NET runtime.


Thanks, i'll give it a shot :)

By the way, when I say Visual C++ and MFC... Are those 2 different things?
This world is ruled by big furry CATS!! :)Meow! :)
I think the technical way to think about it is that MFC is a particular way to use C++.

In my experience (I've used a lot of Win32 API and .Net Forms), .Net forms is *far* easier to get what you want done quickly.

You are free to choose from several languages (C#, C++, and VB are the major ones) if you decide to use .Net.
is there a way to insert C++\C stuff to C# code?
This world is ruled by big furry CATS!! :)Meow! :)
Not exactly. But if you write some code in C++ and compile it as a DLL, there are many ways to use it from C#. Unfortunately you can't #include any C++ source code inside C# files.

[edit] There *might* be a way to merge two .Net 'assemblies' (this is their word for "EXE or DLL or similar file") that were compiled from separate languages into one EXE. I haven't tried that hard to get it to work though, since one EXE and many DLLs works fine for me.
So basically I can use C++ for the class design and C# only for the GUI?
I have managed to combine fortran and C\C++ code and some ASM code with it as well. The thing is that for it to work the program should make an .obj file and then in the compile time all the objects are combined... and you have a multi lang exe program... Actually I have done it in Linux, but that shouldnt be that hard in windows either...
This world is ruled by big furry CATS!! :)Meow! :)

This topic is closed to new replies.

Advertisement