Refering API Dlls

Hi,

I have a very basic doubt. I'm having a static api dll and a header file for its function prototypes. how can i call it from a vc++ project. (I need very basic information like where to change the configuration to include that dll to project)...

Advance thanks...

Muthu R. Krishnan




Answer this question

Refering API Dlls

  • Boris Vidolov MSFT

    Muthu Krishnan. R wrote:

    thanks.

    I couldn't find any .lib files in disk. Is there any utility to generate that from a dll..

    Strange that the distributors of the DLL did not provide an import lib. You can use run-time linking as detailed here :-

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/dllproc/base/using_run_time_dynamic_linking.asp

    ...or you could try and generate a dummy lib (create a dummy CPP file with all the functions, and use empty bodies, then build a dummy DLL out of it, discard the DLL, and copy the import lib over to your other project). I've never tried this out, and am not aware of any side issues, but it should work (theoretically).



  • poliveira

    You terminology "static API dll" is confusing. Is it a static lib, or is it a DLL DLLs expand to Dynamic-Link Libraries, and are not static in nature.

    I'll assume you have a DLL. You'll need to #include the DLL's header file (you said you have one). There'll also be an import lib (that contains stub functions), which you'll need to add to the project's linker modules. That's all. When you run it, make sure the DLL is in the app's search path.

    Also, see http://msdn.microsoft.com/library/default.asp url=/library/en-us/dllproc/base/using_dynamic_link_libraries.asp

    Muthu Krishnan. R wrote:

    Hi,

    I have a very basic doubt. I'm having a static api dll and a header file for its function prototypes. how can i call it from a vc++ project. (I need very basic information like where to change the configuration to include that dll to project)...

    Advance thanks...

    Muthu R. Krishnan



  • LeSa

    Hi!

    Basically you must #include library header file into your source to be able to call library functions. Plus you must add .lib file to the linker options so linker can reference your DLL.



  • Marc_UK

    Thanks ya,

    I have gone through the installation of that product and got that .lib file.

    Thanks for your positive statement...



  • God_Mark

    thanks.

    I couldn't find any .lib files in disk. Is there any utility to generate that from a dll..



  • Refering API Dlls