Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you use DLLs?

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
GB
Hallo.
I have a dll & an .obj file & a .lib file, all created in VC++, unfortunately.
I have converted these to OMF (using Borland's utility), and that seems to have gone fine.
But I now have no idea what steps to take to use the dll in a Builder application.
I've included the .lib and .obj files in the project, but the compiler can't see the implementation of any of the functions.
I'm on a really tight timeline, or I wouldn't post for help before doing more research.
Thanks for any & all help,
Douglas JL

A salesman is a machine for turning coke into obnoxious arrogance.

Common sense is what tells you the world is flat.

 
You also have to include the .h files that define the functions. They should be included with the other files.
 
Yeah, I have included the .h file - I thought that once I'd done that, all I had to do was add the .lib file to the application.
This didn't work (it couldn't see any implementations), so I added the .obj file as well.
But it still couldn't see any implementations.
So I browsed to the dll itself in the packages bit of the options, and still no implementations.
I am rather lost.
DJL

A salesman is a machine for turning coke into obnoxious arrogance.

Common sense is what tells you the world is flat.

 
Try using LoadLibrary and GetProcAddress (implicit linking ,i think, its called).
 
As Supernat03 mentoided you have to use .h file for static linking where you have to write this:
1.Include .Lib in your project
2.Create .h file with declaration of DLL functions:

__declspec(dllimport) int F(int n);//function in your DLL
__declspec(dllimport) void F1(double);
.......

3.Include this .h file in your files where you want to use
DLL functions

That's it all.Simple Is'n it? :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top