Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

About DLL and Lib...

Posted on 2002-03-17
5
312 Views
Last Modified: 2013-11-20
I want to learn how to create a DLL and Lib file. Please any body guide fow to start.

Thanking You
Venu
0
Comment
Question by:vgopalji
5 Comments
 
LVL 2

Expert Comment

by:shilpa_Jb
ID: 6876055
Hi,
Just go through the MSDN help on DLL, i think u get the idea of to create DLL and lib.
Or make use of www.msdn.com
Hope that helps u.
_shilpa
0
 
LVL 1

Accepted Solution

by:
pkreddy earned 50 total points
ID: 6876158
Hi,
 Simplest is to start off by

1. Access App. Wizard from File/New... and choose project tab
2. Choose project type as 'MFC Appwizard(Dll)', this gives you some choice and you can accept defaults.
3. Next, open the '<your_project>.h' file in your project and key in a function declaration with standard naming convetion.
Ex. STDAPI FunAdd(int a, int b);
4. Open you '<your_project>.cpp' file and define the function as
STDAPI FunAdd(int a, int b)
{
 return (a + b);
}
5. Open you '<your_project>.def' file, this will be present in your source files. Under section Exports
Just type
 FunAdd   @1

Now compile your project, it will give you both '<your_project>.dll' and '<your_project>.lib' files.
by default

1. To access the function in the dll, create a sample project to test the dll. In the file where you want to access the dll function type.
STDAPI FunAdd(int a, int b);

 and then in any place where you want to use the function just make a call

int ret = FunAdd(2,3);

Now open ur project settings using Project/Settings... and in the link tab specify the complete path to '.lib' file you had created earlier in "Path to your lib file" in this fashion. Compile your source code.

Now put the dll where your app executable is and execute the app. you should be able to get desired results.

I am being fairly comprehensive in this and will only help to start off. To get a more complete understanding refer to MSDN or any standard books on dll. Also this is one approach of creating dll and if you want an ordinary dll without MFC try out 'Win32 Dynamic-Link library'.

bye
Pavan


0
 
LVL 1

Expert Comment

by:orange_juice
ID: 6880637
thank you pkreddy.... short but comprehensive enough
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 10431625
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: pkreddy {http:#6876158}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

AndyAinscow
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 42
how to monitor remote shell execution on linux 9 104
scoreUp challenge 14 64
"Black Box" Testing of Control System Software 2 70
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 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