Board index » delphi » How do I use the #import statement ?

How do I use the #import statement ?

I have a dll I need to import into a project.

The compiler give me an error on:  #import "SomeDll.dl"

What am I missing ?   (some include file ?)

Thanks in advance,



Re:How do I use the #import statement ?

Read the help.  #import is used to import information from a type library,
not from a DLL.

.  Ed

Re:How do I use the #import statement ?


    Assuming you're using Borland C++ 5.x or older, the compiler doesn't
know the #import directive (I think it's from M$ Visual C)...

    IF you wrote the DLL, then just add it to your project, otherwise (you
didn't write the DLL and you don't know which development tool was used to
build it) try this in the command line (DOS Box):

    implib mydll.lib <the path to the dll>\mydll.dll

    Then add mydll.lib to your project.


Gonzalo N?ez Riboni
Puebla, Puebla

Other Threads