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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use other .dll files's function for my current .cpp program

Status
Not open for further replies.

rhpingwoo

Programmer
Mar 5, 2003
15
AU
Hello,

This may be a very silly question to some people, but I am new to visual C++ programming.

Can someone tell me how I can include the function from an old .cpp program which generated a .dll file, in my current .cpp program.

Just said there is a fuction call "Checking" in ABCD.dll file, and now i want to use it in my program, how do I do it?? Do I just simply use a #include???

Thanks
~.~
rhpingwoo
 
you have to have the entire function signature declared correctly. Ideally you would have a header file provided by the manufacturer of the DLL that you can include

Code:
#include "theheaderfile.h"

Then you need to link to the DLL through a "lib" file

Code:
#pragma comment( lib, "lib_file_name")

hope that helps
-pete
 
how do i call the function in lib then???
Just like all the other class??

If the function is call "Checking", so i just say
lib::checking()
??

raph
 
>> how do i call the function in lib then???
>> Just like all the other class??

just as when the function is part of the code of your project. The declaration of the function signature determines how you must call it yes?

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top