Sign in to follow this  

How to use a DLL in VC 6.0?

This topic is 3465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I used the #import "dllname.dll" at the top of my cpp file but when I try to compile it, it says that it cannot find the library for it, while the lib file is in my project directory. How do I show Visual Studio 6.0 how to find the library file for that dll. -Thnx

Share this post


Link to post
Share on other sites
Firstly, Visual Studio 6 is horribly out of date. It predates standardisation of C++ and therefor offers pretty poor support for proper modern usage of the language. You can get the 2008 Express Editions (which are the latest version of VS) for free from Microsoft. I can't recommend updating your tools strongly enough.


But, to take a shot at answering your question, have you added the library in question to your additional dependencies (I can't recall how that's done in VS6, but now that you've got the term you should be able to google for it)?

Share this post


Link to post
Share on other sites
Quote:
Original post by jbadams
But, to take a shot at answering your question, have you added the library in question to your additional dependencies (I can't recall how that's done in VS6, but now that you've got the term you should be able to google for it)?

In addition to what you already said, this is yet another reason to upgrade. Virtually no one else uses VC6.0, so pretty much anything you ask will be answered with "I can't remember how it worked in VC6.0".

Share this post


Link to post
Share on other sites
Ummm... I normally use:
#pragma comment(lib, "dllname")

Make sure that the dll is in the same directory as the program exe too. Failing that, just copy the dll into your windows\system32 directory and see if it picks it up there.


Share this post


Link to post
Share on other sites

This topic is 3465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this