IDL C++ interaction

C++

We are often asked if IDL can call C++ code. Compatibility with C has always been a strong design goal for C++, and C++ is largely a superset of the C language. It certainly is possible to combine IDL with C++ code. Callable IDL is especially simple, as all you need to do is to include the idl_export.h header file in your C++ code and then call the necessary IDL functions directly. Calling C++ code from IDL (CALL_EXTERNAL, System Routines) is also possible, but there are some issues you should be aware of:As a C program, IDL is not able to directly call C++ methods, or use other object-oriented features of the C++ language. To use these C++ features, you must supply a function with C linkage (using an extern "C" specification) for IDL to call. That routine, which is written in C++ is then able to use the C++ features.IDL does not initialize any necessary C++ runtime code. Your system may require such code to be executed before your C++ code can run. Consult your system documentation for details. (Please be aware that this information can be difficult to find; locating it may require some detective work on your part.)

你可能感兴趣的:(IDL C++ interaction)