Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

HelloWorld.dll: The simplest way to create your first DLL

0.00/5 (No votes)
7 Feb 2013 1  
How to create your first DLL without coding too much... :)

Introduction

This tip is for seriously lazy people who don't take themselves too seriously and want to get over the creation of their first DLL quickly. This is an advanced beginner tutorial, not necessarily recommended for beginners.

Prerequisites 

You need to have the Microsoft Incremental Linker (link.exe). It comes with Microsoft Visual C++ and older MASM32 distributions. If you have Visual C++ installed then the linker is located somewhere around "c:\Program Files (x86)\Microsoft Visual Studio X.0\VC\bin\".

Creating your DLL

Run the following command: 

LINK /OUT:HelloWorld.dll /DLL /NOENTRY /NODEFAULTLIB 

And voila! Congratulations!!! You have created your first DLL! You can load it with LoadLibrary(), and unload it with FreeLibrary(), but demonstrating that is out of the scope of this beginner tutorial.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here