?
Solved

Loading DLLs and Libraries

Posted on 1998-05-10
4
Medium Priority
?
241 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 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