Solved

Loading DLLs and Libraries

Posted on 1998-05-10
4
237 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
  • 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

770 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