How make DLL using C/C++ in Visual Studio 2005?

Creation of DLL task in visual studio 2005 is so simple. Follow the following
steps to make DLL in visual studio 2005.

Make new project via using menu or press “Ctrl+Shift+N”.

Select Win32 from Project types and select “Win32 Console Application” project
template.

Give project name which you want, select location of project where you want to
save. Press OK.

Win32 Application Wizard will welcome you, press Next button.

You have to select DLL in application type and Press Finish.

Your project will create. Build your project and get Library File(.lib file) and Dynamic Link Library (.dll file).

Now, important thing related to exporting function. There is two ways of exporting function. One, using Module-Definition File (.def file) which is old way to export DLL (I like this way), second way, export function using Microsoft Specific extension of the C language via using __declspec(dllexport) keyword.

For learning these ways visit following sites.

(using def file)
[link] http://msdn2.microsoft.com/en-us/library/28d6s79h(VS.80).aspx

(using keyword)
[link] http://msdn2.microsoft.com/en-us/library/a90k134d(vs.80).aspx

By,
-–| AimsLife™ |–

9 thoughts on “How make DLL using C/C++ in Visual Studio 2005?

  1. Man if you want to write something good , write a complete tutorial about how to create a dll. Many people can figure on their one the part with the New Project and select the dll radio button.

  2. Hi

    I am trying to create a DLL which will be combination of a number of .obj files. Some of the object files will be present in some other location. Please let me know where to specify the location of object files in VS?

  3. hi,

    I want to create a resource file which embeds an image file in it.and create a dll out of it for my present project.Project is a standalone windows application written using CLR,managed C++ on the >net framework 4.0 and Visual Studio 2010

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s