Link to home
Start Free TrialLog in
Avatar of lcrogers
lcrogers

asked on

the easiest way to build a dll file

IS there an easy way to build an DLL file??  Where can I find the infomation to build a DLL file?  I am using msvc++ 6.0.
ASKER CERTIFIED SOLUTION
Avatar of DrDelphi
DrDelphi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
>>IS there an easy way to build an DLL file??

I think you want to create a DLL file.   The easiest way to do that is to use the VC++ AppWizard.  Just choose File/New, Projects then select either
   MFC AppWizard (DLL)
or
   Win32 Dynamic Link Library.

Depending upon options that you select in teh Wizard, it will create a skeleton of a DLL... all you need to do is add some code and (optionally) some resources.

-- Dan
Avatar of jimbucci
jimbucci

Exactly - VC6 will do the work for you
Jim
Of course, everybody knows that "Real Programmers" never use Wizards!!  ;-)
i am giving a skelton program try it out.
Take a project option as win32 dynamic link library
name of the project is DLLTEST
in that add sum.h and sum.cpp
write the following code in sum.h
extern "C" __declspec(dllexport)
int sum(int x,int y);
write the following code in sum.cpp
#include "sum.h"
int sum(int x,int y)
{
return x+y;
}
build it.now it generates DLLTEST.lib and DLLTEST.dll

for testing the above dll write one console application i meant client for this
take new IDE.select project option win32 console application
add client.cpp
write the following code in client.cpp

#include <iostream.h>

extern "C" __declspec(dllimport)
int sum(int x,int y);

void main()
{
cout<<sum(3,5);
}

copy the dll in to your client debug directory.and specify the lib name in project->settings->link tab->object/library modules section
and set the path for lib in tools->options->directories->library files

i think this will helps u.
Yeah, you could always do it in assembler.
Probably better to just use hexadecimal opcodes directly.  Assembly language is for wimps.
opcodes - my 19 month old can do opcodes.  Get some punchcards and do it in binary...  If you're a REAL programmer.  
But if you want to save time - the wizards do all the work.
Thank you and good night.
JB
Binary?  Back when I started we didn't have ones and zeros.  We had to work with only zeros AND WE LIKED IT.
<bows>
Dear

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "DrDelphi"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Force accepted

** Mindphaser - Community Support Moderator **