Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

About DLL and Lib...

Posted on 2002-03-17
5
Medium Priority
?
329 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
[X]
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
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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 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