Hi,
I am fairly clueless when it comes to C++, so I'd appreciate any help.
So.... I have a dll for a machine. What exactly do I do with it? i.e. How do I include it into the code, access and use the functions inside it, etc.
Regards
Brownie
Hi,
I am fairly clueless when it comes to C++, so I'd appreciate any help.
So.... I have a dll for a machine. What exactly do I do with it? i.e. How do I include it into the code, access and use the functions inside it, etc.
Regards
Brownie
You need more than the DLL - you need a .lib file as well to be able to find out what the functions are inside the DLL, and a .h file so that your compiler can connect the dots between the source and the .lib file.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Ok so..... Found all that stuff. So what do I do with it? I'm guessing I include the headers as normal, but what about the .dll and the .lib
Brownie
[Windows XP & Visual C++ 2005 Express Edition]
You might have to point express to the directory (if it's like '03 Tools->Options->Projects->VC++Directories-> modify paths in drop down menu. Library files to where the dll/lib are and header files to where the header is). Alternatively throw 'em all into the project directory from which you're working. Then type in #pragma comment( lib, "my_lib_file.lib" ) and #include "my_lib_file.h" and call a function from the dll, as per the header file.
You link with the .lib file ["additional inputs" or some such in the Visual Studio project Linker tab], and place the DLL where it can be found when running the application (say the same directory as the .exe file).
Of course, you may need to follow certain steps to use the functions in the DLL. As you haven't told us what DLL you are trying to use, I can't even guess what that may involve.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Thanks for the help Mats and Twomers. I'll try that out later and see how it works