Solved

About DLL and Lib...

Posted on 2002-03-17
5
294 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 76
bigDiff challenge 17 83
centeredAverage challenge 8 130
pre4 challenge 19 93
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now