tags:

views:

474

answers:

2

In all ADO C++ code I can find, there is a line

#import "C:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")

I understand that this line "incorporate information from a type library", and that "The content of the type library is converted into C++ classes". What?

I'm also looking for the header file for ADO C++, but I can't seem to find it.

+1  A: 

It's been a while since I played with that stuff, so what follows is a bit vague and may even be slightly inaccurate, but I hope it still helps:

The DLL implements COM interfaces, and contains a type library describing those interfaces. Among other things, a type library contains the IDL of those interfaces, which should be compiled to generate C++ header files that your program can use.

The #import directive automates the process of extracting the TLB from the DLL and compiling the interfaces it describes to generate the corresponding C++ headers, and #include-ing the generated headers.

Éric Malenfant
A: 

#import will generate the header file for you. In this case have a look for msado15.tlh in the intermediate directory (ie, projectname/debug).

DanDan