: : hi i am basically a c/c++ programer. i have to start working on windows programing and need to take a decision. for windows programing i can use win32 SDK or MFC also as basically MFC are the wrapper classes over win32 APIs..fine. recently, i come to know that i can program windows using c# also, can anybody please suggest me which technology is the best to do windows programing, MFC or C#? whats really the difference between these 2 as related to windows programing?
: :
:
C# is based on .NET platform, and it is the future of Windows programming. New Windows 'Vista' (or Longhorn - old name) will be using C# and VB .NET mainly for applications.
:
: Win32 is a little faster and has more control over the system. When I was coding some GUI - I did not find (in C#) a few functions I needed. But, C# and Win32 can be mixed (you can use Win32 API inside C# code), so that was not a huge problem, just an annoyance.
:
: C# is portable (or so Microsoft boasts), so the code compiled on Intel, should run on Mac and vice versa.
:
: Also, if you go with C# - you need to get up to speed on .NET platform - just read MSDN - it has a whole description of all classes and namespaces in .NET and what they needed for.
:
: Now, MFC: one thing - it is old (very old). It is still supported. I just wrote MFC application using VS .NET 2003.
:
: When you write Windows application (not Web app.) in C# - you need to use new approach to programming. Example: I needed to move a window. The .NET class Form provides the window functionality, so I was looking for a function to move a window (MoveWindow in Win32). Did not find it. The way to move a Form is to set Left, Top and Size properties:
:
:
: Form wnd;
:
: wnd.Left = 64;
: wnd.Top = 64;
: wnd.Size = new Size (400, 500);
:
: //wnd.Width = 400;
: //wnd.Height = 500;
: // That ^ is better (not creating a new object)
:
:
: That code will move a window on screen. Weird!..
thanks AsmGuru62, u gave me the best possible and to the point reply, thank you very much for ur advice. my employer has choice for me to go either for vc++ or c#. as advised by u, certainly i m going to choose c#, one for its the latest n secondly as u told i still can use win32 APIs through it...thanks a bunch n gud luck!!
Also, lastly, could u please suggest me the best book or resources to learn C# which could give me indepth knowledge, at beginers n advanced level, about C#?