Skip to main content

Interoperability

  • Chapter
C++/CLI
  • 1098 Accesses

Abstract

Interoperability, or interop as it is usually called, refers to using or invoking program code from some other programming environment or language, for example, calling COM or native C++ code in a managed language. Interop is a complex but beautiful and extremely necessary thing. Many people think that the C++/CLI language for the .NET platform would be used primarily to extend existing code bases written in native C++. While there is no reason why you could not use C++/CLI as your .NET language of choice, the support that C++/CLI provides for native code interop on the .NET platform is indeed impressive. In many cases, you simply turn on the /clr compiler option and recompile your native code, producing managed code (or at least mixed code that’s mostly MSIL but with a few native x86 or x64 instructions mixed in). This feature was called IJW or “it just works” when it was originally released along with Managed Extensions for C++. And for the most part, it was true. It’s now called mixed mode. A huge amount of work went into making that type of interop possible. Also, even if you’re writing an entirely new application that uses a native API, such as Win32, interop support in C++ makes it easier and much faster to call these APIs in C++ than it is in C#.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 79.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Gordon Hogenson

About this chapter

Cite this chapter

(2006). Interoperability. In: C++/CLI. Apress. https://doi.org/10.1007/978-1-4302-0282-0_12

Download citation

Publish with us

Policies and ethics