Cannot understand relationship between normal c++ vs vc++, win32 programming, mfc, win32 api, CLI [closed]

早过忘川 提交于 2019-12-24 04:41:00

问题


  1. What is the mfc, cli and win32? Can you please help me understand how visual studio works in relationship with these 2?
  2. what is the diff between c++ and vc++? When we say "vc++" does it imply the dialog boxes, forms, windows and other gui elements by default?
  3. If i create a console based application in visual c++, without using any win32 programming, does it qualify as a visual application?
  4. Do the boxes, dialog boxes, forms and other gui, come under win32 programming or are they different?
  5. What other kinds of programming are there in c++ other than console based and win32 programming?

Please make it as simple as possible.


回答1:


C++ is a programming language. It's compiled, which means you need a compiler to translate the source code into an executable program.

VC++ is a compiler from Microsoft which runs on MS Windows, and compiles C++ code into executable programs for MS Windows operating system.

There are various kinds of programs that you can write in C++, ranging from device drivers to webbrowser plugins. Well, you could even write your own operating system if you fancy that.

To ease your development, compiler developers (and third parties) have written various kinds of useful libraries. MFC is an example of a library (a framework to be more precise), which helps you in development of "visual applications" on MS Windows. There are other alternatives to MFC in the market.

Now coming to your questions:

  1. MFC is Microsoft's framework for creating visual applications in Visual C++. CLI is command line interface. CLI applications typically don't have any visual element except for the command line input---they mostly don't have any menus and mouse interaction, either. Win32 is a generic term for 32 bit MS Windows application. You could also develop for 64 bit Windows.

  2. C++ is a language. VC++ is a compiler. This compiler comes with some additional features, beyond what's available in C++ to ease MS Windows development, specially via MFC.

  3. There is no standard term as a "visual application" but loosely speaking, without graphical elements your application won't be considered a visual application.

  4. Dialog boxes, forms and other GUI elements do come under Win32 programming. You could make use of MFC to ease your development of such Win32 applications, as hinted earlier.

  5. Beyond console based and Win32 Programming: I think you are getting confused because of the various "wizards" that come with Visual Studio when you create a new C++ project in the IDE. There could be several types of wizard configured in your installation; just to give you a few examples: you could also have ActiveX and MFC controls as the "type of application" you want to create.




回答2:


Ok, lets start with Windows. Windows is built using C/C++. You can write a Windows program using the functions Windows offers you - this is Win32.

MFC = Microsoft Foundation Classes - a C++ class library that wraps around the Win32-Interface. It is a pretty thin wrapper, that means you still can (and sometimes have to) access the Win32-function. The buttons, dialog boxes, etc. are original controls from Windows.

A console application is designed to run in the command line (a.k.a. dos box). You can use parts of Windows like processes, file system, etc., but no "optical stuff" like dialogs.

VC++ is a term often used for C++ with MFC, or at least C++ under Windows.

HTH a little bit.



来源:https://stackoverflow.com/questions/10529544/cannot-understand-relationship-between-normal-c-vs-vc-win32-programming-mf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!