tags:

views:

204

answers:

1

how is dll created out of c++ source and how it is used in other source?

+5  A: 

The DLL is a 'Dynamic Link Library' which works a lot like other libraries but is not linked with your executable application. At run time you can call specific functions for loading your DLL and executing its exported methods.

You can try creating a DLL yourself- create a project using visual studio and specify a DLL. This will create some of the base constructs for your project such as settings for your project to compile the DLL and also some base code for exposing methods, objects, or variables.

There are many walk through's to help you at this point: check here.

So, to summarize:

  • A DLL is a library which you can be loaded at runtime. This is a very flexible 'plug-in' model. Example: You can programmatically select and load different DLL at runtime. Each DLL can be a 'plug-in' to provide different functionality.

  • A DLL Has an entry point. Just like your Main function of your command line executable is the entry point, the DLL has an entry point function which is called when different events occur on the DLL such as loading, unloading, and more.

  • To use a DLL you must use the exported objects or methods of the DLL.

  • When Calling these exported functions from another application it is very important that you match compatible types! Also, make sure the calling conventions are compatible

Klathzazt