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

How to include a .dll in your project

Status
Not open for further replies.

rexy

Technical User
Oct 8, 2002
2
US
I would like to enquire if there is any way where you can include or add a .dll file into a existing project. I know that you can include a .h file easily into your project, but is it the same way as you include a .dll into the project as well?

Well, it goes like this, i am suppose to print a barcode using a barcode printer, and i'm using Visual C++ to activite the printing process, as in normal printing process in Visual C++. However, the problem is that i need to include the barcode font dll file into my project. If i am to add the dll file in the same way as including a .h file into my project, it gives me error and could not print the barcode string, instead, it print out the words.

Hence, i do hope that anyone would be able to help me with it(ie to iclude a .dll file into the exisiting program).

Your help will be deeply appreciated.
 
This is the way I include a .dll file in VC++:

#import "C:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")

The reason for the no_namespace thingy is so that the EOF function in the ADO library is renamed to EndOfFile and won't be confused with and file I/O I may do. You probably won't need no_namespace or anything afterwords. Put this #import directive before any of your #includes....don't think it would hurt anywhere else...It's just how I do it and it seems to work okay for me.

Niky Williams
NTS Marketing
Niky.Williams@NTSMarketing.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top