Solved

How to avoid loading 3rd party DLL?

Posted on 2002-03-15
5
254 Views
Last Modified: 2010-04-01
I program in Visual C++ version 6 on Windows NT 4.  A third party provides a DLL, a link-time library to go with that DLL, and a header file.  Whenever I link my program to the 3rd party library, my program will demand the presence of the DLL at startup, regardless of whether or not my program actually reaches any function calls to the 3rd party library.  I want to avoid installing the DLL in all the computers around the world that run my software.  I want to limit distribution of the DLL just to those computers that need its functionality.  I do not have the source code for the DLL or the 3rd party link-time library, and the 3rd party has so far been uncooperative in helping me achieve my goal.  Do I have any way out?

Thanks,
     - David
0
Comment
Question by:dwhite494
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6869506
>>Do I have any way out?

Yes - use the "/delayload" liker option, e.g.

/delayload:3rdparty.dll
0
 
LVL 86

Expert Comment

by:jkr
ID: 6869515
BTW, to elaborate: This option will cause the DLL to be loaded only when it is needed, i.e. the 1st time a function of the DLL is being called. Just add the above statement to your linker options for your project.

0
 
LVL 1

Expert Comment

by:allym
ID: 6869559
Another way is not to link with their .lib file, but pull in the DLL with the LoadModule() API call and then get the address of the function(s) you use with GetProcAddress().
However, the linker option is much easier to use as you won't have to modify your code.
0
 

Author Comment

by:dwhite494
ID: 6869858
Mr./Ms. "JKR" continues:
BTW, to elaborate: This option will cause the DLL to be loaded only when it is needed, i.e. the 1st
time a function of the DLL is being called. Just add the above statement to your linker options for
your project.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6870219
"Mr." is OK :o)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question