Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Loading DLLs and Libraries

Posted on 1998-05-10
4
Medium Priority
?
242 Views
Last Modified: 2010-04-10
What exactly is loading a library and DLL. how Do I go about doing it in C++ ?
0
Comment
Question by:unagsr02
[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
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 20 total points
ID: 1175420
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1175421
Loading a library and loading a DLL is a the same thing (A DLL is a library in windows.)  You can explicitly load a DLL using the windows API procedure LoadLibrary().  This takes a single parameter that is the disk name of the DLL to be loaded.  (If you don;t specify a path, windows will look for the DLL in several directories that tend to have DLLs)  The procedure returns a handle to the DLL.  The handle is a meaningless value to your program, but you can use it as a parameter in some of the windows API procedures (It is not meaningless to windows--it identifies the DLL to windows).

continued.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1175422
One important procedure you can use the DLL handle with is the GetProcAddress() windows API procedure.  This procedure takes the handle to the DLL that you loaded and  the name (or number) of a procedure in the DLL and returns a pointer to that procedure.  You can then use the pointer to call the procedure.  (Without this procedure, loading DLL's would be useless.)

Another important procedure is FreeLibrary().  When you are done with a DLL, you use FreeLibrary() to release the DLL.

I hope this helps.  Ask if you have additional questions.
0
 

Author Comment

by:unagsr02
ID: 1175423
Hello, Thanks For Your Answer... This makes it pretty clear and i accept your answer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

636 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