Management extensions for C + +

Source: Internet
Author: User
Tags wrapper wrappers advantage

Brief introduction

C + + Management extension is a set of language extensions that help Microsoft Visual C + + developers for Microsoft. NET to write the application.

Management extensions are useful if you:

Want to increase the developer's use of C + + writing. NET application Productivity

A large segment of code is to be ported from unmanaged C + + in a phased manner. NET Platform

You want to use an existing unmanaged C + + component from a. NET framework application.

You want to use the. NET framework components from unmanaged C + +

Mix unmanaged C + + code and in the same application. NET code

C + + Management extensions provide developers with unparalleled flexibility in locating the. NET framework. Traditional unmanaged C + + and administrative C + + code can be freely mixed in one application. Applications written with administrative extensions can take advantage of the advantages of two kinds of code. With administrative extensions, existing components can be conveniently encapsulated into. NET component, in the with. NET integration while retaining the original investment.

What is a management extension?

Extensions allow you to write management (or. net) classes that run under the. NET Framework control in C + +. (Non-managed C + + classes run in a traditional Microsoft windows-based environment.) A management class is built in. NET class, you can take full advantage of the. NET Framework.

Management extensions are new keywords and attributes for the Visual C + + development system. They allow developers to decide which classes or functions are compiled into administrative or unmanaged code. These sections can then be smoothed to interact with other parts or external libraries.

Administrative extensions are also used to represent in C + + source code. NET types and concepts. This allows developers to write easily. NET applications without the need to write extra code.

Main use environment

Migrate existing code smoothly to. NET

If you have a lot of investment in C + + code, management extensions will help you move them smoothly to. NET platform. Because you can mix management and unmanaged code in an application--or even in the same file--you can transfer code over a long period of time, one component after another. NET. Or you can continue to write components in unmanaged C + + to take advantage of the power and flexibility of the language, and only use management extensions to write a small number of high-performance wrappers (it allows your code to go from. NET components.

From. NET language to access C + + components

Admin extensions allow you from any. NET language to invoke the C + + class. You need to use extensions to write simple wrappers that expose your C + + classes and methods to management classes. The wrapper is a complete management class that can be from any. NET language. The wrapper class is the mapping layer between the management class and the unmanaged C + + class. It simply passes the method call directly to the unmanaged class. Administrative extensions can be used to invoke any built-in dynamic-link library (DLL) and built-in classes.

accessing. NET classes from built-in code

With administrative extensions, you can create and invoke directly from C + + code. NET class. You can write a will. NET component as any other C + + code that manages C + + classes. You can invoke the. NET class using COM that is built into the. NET Framework. Whether you use COM or use administrative extensions to access. NET components depends on your project. In some cases, leveraging existing COM support is the best option. In other cases, using administrative extensions can increase performance and developer productivity.

Administration and built-in code in the same executable file

The Visual C + + compiler can translate data, pointers, and instruction flows automatically and transparently in both administrative and unmanaged contexts. This process is a process that allows management extensions to interoperate seamlessly with unmanaged code. The developer can control what data and code can be managed. The ability to choose whether each class or function is managed or unmanaged provides greater flexibility for developers. Some code or data types perform better in a unmanaged environment. Management code, on the other hand, improves developer productivity due to features such as fragmentation collection and class library. Existing unmanaged code can be converted to management code one at a time, thus preserving existing investments.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.