c++comidl

Difference between idl and odl


What is main difference in IDL and ODL. I have many projects, some of them has idl and some of them have odl. And where I should use them. What are tradeoffs.


Solution

  • ODL is a legacy format. It's been replaced by MIDL (a.k.a: IDL). Check this official Microsoft article: MIDL and ODL

    The Microsoft Interface Definition Language (MIDL) now includes the complete Object Definition Language (ODL) syntax.

    Now, if you have ODL files, you can keep it as is, or migrate them into IDL. That would be the recommended solution but it can be error prone. It's very related to the tool you curently use to build the generated files from it, MIDL.exe or MkTypeLib.exe. Check again the official documentation about these: Differences Between MIDL and MkTypLib

    In general, you will want to use the MIDL syntax in your IDL files. However, if you need to compile an existing ODL file, or otherwise maintain compatibility with MkTypLib, use the /mktyplib203 MIDL compiler option to force MIDL to behave like Mkktyplib.exe, version 2.03. (This is the last release of the MkTypLib tool.) Specifically, the /mktyplib203 option resolves these differences: