C++/CLI Fundamentals


Introduction to C

In the world of computer programming, C has always been considered a powerful language. It was developed by Kernighan and Ritchie and became widely accepted. This was amazing because C was never an easy language. After a while, with the high demands of computer programs, C lacked some features of a cute language. Nevertheless, because of its strengths and its ability to communicate with low-level languages such as Assembly, the C language was highly used to develop widely used operating systems, including Microsoft Windows, Unix and Linux.

Win32: A Library

To make it possible for people to write programmers that run on Microsoft Windows operating systems, Microsoft developed a library named Win32. This library is mainly a series of objects and their behaviors that define how to create programs that allow a person to interact with a personal computer (PC).

Introduction to C++

C++ is a computer language that was developed by Bjarne Stroustrup, from AT & T. Instead of completely reinventing the wheel, he based it on the C language. He added various features such object-oriented programming (classes) and inheritance, just to name a few. Based on the solidity of C++, the language laid a great foundation that many other programming languages imitated.

From its original implementation, C++ lacked a few features that some other languages had. For example, C++ didn’t have a string data type. It had some limits on file streaming. It also had little or no support for web programming, native database development, XML, etc.

Still, because C++ featured many strong qualities, various new languages were based on it, including Java, JavaScript, and lately C#. As you would guess, these new languages completed what C++ lacked. Alternative languages were also developed to perform tasks that were difficult in C++. These languages included Perl, Microsoft Visual Basic, PHP, VBScript, etc.

C++ and many other languages have always benefited from additional libraries. These were used to provide support for areas that probably were not dealt with when the language first came up. In fact, these libraries are what usually makes a language appealing. Some of the libraries that assist C++ are STL and boost. Still, with the high demands of modern assignments, and considering that C++ has not been updated for a while, apparently some of its shortcomings have not evaded.

The Microsoft Foundation Classes Library

As the Microsoft Windows 3.X and then 5.5 operating systems were becoming popular, many programmers were interested in creating graphical programs. They had to use Win32, which made it possible only to use C to create programs. With this approach, everything was done manually, including the design and code writing, which was an increasing demanding task, wasting a good deal of time.

Remember that Win32 was written in C and had no native support for C++. Therefore, Microsoft created a library, named Microsoft Foundation Classes Library, and abbreviated MFC. This library was originally an “adaptation” or customization of Win32, adding object-orientation (classes and inheritance) to it. Because Win32 was written in C, it also carried C’s limitations, such as a rough or little support for file streaming, web programming, XML, little support for object serialization, etc. The MFC library was a great addition and overcame many C’s limitations.

Microsoft Visual C++ in the Mix

The MFC is a library and can be used to manually develop programs. To make the use of MFC friendlier, Microsoft developed Microsoft Visual C++. This is a graphical programming environment that allows designing Windows objects and writing code to implement their behavior. As its name indicates, this environment takes C++ as its base language. Fortunately, using MFC, it goes over some of the limitations of C++ and takes advantage of MFC’s classes.

Microsoft Visual Basic

To use the Win32 library, a programmer had to know either C or C++. To use the MFC, you had to know C++ and have the patience of using it with its pointers and memory management. To alleviate these and other types of challenges to create or develop graphical windows, Microsoft created Microsoft Visual Basic as a relatively easy-to-use language. This programming environment appeared to be friendlier than Visual C++. While Microsoft Visual C++ perfectly “understands” Win32, one of the shortcomings of Visual Basic is that it cannot directly interpret Win32 code. To use Win32, you had to “import” or “load” the necessary function from Win32 into Microsoft Visual Basic.


Home Copyright © 2006-2016, FunctionX, Inc. Next