C++/using DLL in C
Hi! I write C program. How can I reference a DLL and using its function. Could I have a simple example from you. Dynamic link library has two format: .DLL and .EXE. In my case, .EXE is used.
Thankyou for your question, i hope this will help
you clarifying your concept.
a DLL is simply a set of compiled
(just like a .obj that is created by your compiler). So, you can link
DLLs with any of your projects, the only requirements are:
1. That you know which functions are included in the DLL and
2. That you use the same compiler that was used to create the DLL.
Requirement #1 is usually simple to solve since the DLL provider
gives a header file to use. But if you don't have any header to
you have to know the exact signature of the functions you would like to
use from the DLL, and declare them as external linkage like the
extern int someExternalFunction( void ) ;
You can now use "someExternalFunction" as any other function, but you
have to link the DLL with your project.
Requirement #2 usually forces you to use the Microsoft compiler (Visual
for instance), but other compiler can provide some tools to convert the
DLL into their own format if needed (Borland provides such tool).
As to link with a EXE, it should work since there isn't much difference
between a DLL and a EXE. I never tried it though...
I hope this will help!
Good luck with everything!