Showing posts with label odl. Show all posts
Showing posts with label odl. Show all posts

Wednesday, August 22, 2012

ODL vs IDL

Copied for longevity

(from the great Igor Tandetnik):

The difference is not between ODL and IDL - you can change the file
extension to .idl and it will behave exactly the same way. The
difference is in the file structure.

The way MIDL compiler works, .h file is generated based on the
declarations _outside_ the library block. TLB is generated based on the
declarations inside the library block. The usual approach is to defined
all the interfaces (and structs and enums) outside the library block,
then mention them inside (usually as part of coclass statement). This
way, you would get them both in the header file and in TLB.

Your ODL file, I bet, defines everything inside a library block.

(from the great Alexander Nickolov):

If you deselect ODL mode for your MFC project, you must also
rename it with IDL extension since it's no longer an ODL file.
ODL = Object Description Language - only describes type libraries
IDL = Interface Definition Language - describes both interfaces and
type libraries (contains ODL as a subset).

Historically, initially IDL coudn't be used for type libraries, so
Microsoft invented ODL. Later they joined the two languages
under the IDL name. IDL itself is inherited from OSF DCE RPC
spec and extended to support COM interfaces. It does contain
the original IDL as a subset - you can still use it to define RPC
interfaces (e.g. don't specify [object] for the interface).