4

In C++ I've never seen an #import line that imports a .exe like the following line:

#import "C:\Program Files\Google\Google Earth\googleearth.exe"

What does the line do and how can I interpret/understand it?

2
  • 2
    Where did you find this code ?
    – P0W
    Jul 8, 2015 at 1:09
  • 2
    @P0W I like how you make it sound like some sort of ancient magical artifact or something, +1.
    – Sam Estep
    Jul 8, 2015 at 1:17

1 Answer 1

10

It's a VC++ extension that lets you import information from a type library.

Used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces

So in this example, your program would have access to the COM interfaces exported by the Google Earth program without needing an explicit header file to define them (although I believe the GE COM API has actually been deprecated so this may not work with current versions of the software).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.