C# and MFC



I'm just wondering if you will be able to use mfc in c#.. I'm new to C# and evaluating if it is possible to port old MFC programs to C# compiler and then program new UI under C#.

1. I heard that C# is good to do UI program, is it true
2. Is C# program portable everywhere
3. Is C# supports MFC programs

Thanks


Answer this question

C# and MFC

  • khawarpasha

    Hi. MFC provides encapsulation for the Windows API, that is, instead of using HWND and WNDCLASS and lots of API functions you have nice classes like CDialog, CFormView, CButton, CEdit and other classes like CString, CArray, CMap etc etc to make your life easier. As it says the MSDN "MFC makes it easy to build the interface for a spreadsheet application..." the .NET Framework as in MSDN "The .NET Framework consists of two main parts... and a unified... environment for building smart client applications (Windows Forms)..." that is, Form class, Button class, TextBox class and others like String class, ArrayList class, Hashtable class etc etc.

    read this links... I think you'll find the answer.

    http://www.codeguru.com/forum/archive/index.php/t-181518.html

    http://www.flounder.com/csharpfactoids.htm

    1. I heard that C# is good to do UI program, is it true -- yes
    2. Is C# program portable everywhere -- you have http://www.mono-project.com/
    3. Is C# supports MFC programs -- read above

    regards.


  • RCharles

    There is a program call RC Converter (dudelabs.com) that will port the UI portion of an MFC program to C#. I personally like Windows Forms better than using MFC for creating a UI. C# does not support MFC programs.
  • BroadSurf

    // I'm just wondering if you will be able to use mfc in c#..

    No.

    1 - yes, WinForms is a good framework

    2 - No. C# requires the .NET framework, and that only really exists under windows, Mono notwithstanding

    3 - No, no way. MFC is a C++ wrapper around win32.



  • C# and MFC