You are here:

C++/.dlls in c++

Advertisement


Question
hello,
what are dll files?

are they different in windows and turbo environment?

how are they created and what are their format?

how to use dll files in c++, means how to call functions from dll and to create functions in them?

how can we know that what function dll file contain if use third oart dll file or windows dll file for example i want to restart or shutdown the computer through c++ programming then how this will be performed?

thanks
with regards naveen.

Answer
> what are dll files?

a library is a collection of subroutines used to develop software.
Libraries contain code and data that provide services to independent programs.
This allows code and data to be shared and changed in a modular fashion.
A static library, aka archive, consists of a set of routines which are copied into a target application
by the compiler, linker, or binder, producing a stand-alone executable file.
The linker resolves addresses into fixed or relocatable addresses (from a common base).

Dynamic linking means that the subroutines of a library are loaded into an application program at runtime,
rather than being linked in at compile time, and remain as separate files on disk.
Operating system loaders can link in a library at loadtime, before the process starts executing;
or wait until after the process has started to execute and link in the library just when it is actually referenced.
Such libraries are called dynamically linked libraries.

> are they different in windows and turbo environment?
They are somewhat different in windows and unix operating systems.
AFAIK, there is no execution environment called 'turbo environment'.

> how are they created
depends on a. the operating system b. the toolset that you are using
for example, if you are using the microsoft tools on a windows platform,
see: http://msdn.microsoft.com/en-us/library/ms682592(VS.85).aspx

>  and what are their format?
depends on the operating system
for example, if dll is a windows PE (the Win32 Portable Executable File Format) file,
see: http://msdn.microsoft.com/en-us/library/ms809762.aspx

how to use dll files in c++, means how to call functions from dll and to create functions in them?
depends on a. the operating system b. the toolset that you are using
for example, if you are using the microsoft tools on a windows platform,
and want to use runtime dynamic linking,
see: http://msdn.microsoft.com/en-us/library/ms685090(VS.85).aspx

> how can we know that what function dll file contain
depends on a. the operating system b. the toolset that you are using
on windows, for dlls in COFF format, you could use dumpbin with a /EXPORTS switch.
see: http://support.microsoft.com/kb/177429  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.

Experience

about 15 years or so

Education/Credentials
post graduate engineer

©2016 About.com. All rights reserved.